Skip to content

Commit c3f115a

Browse files
Alex Elderdavem330
authored andcommitted
net: ipa: kill ipa_clock_get()
The only remaining user of the ipa_clock_{get,put}() interface is ipa_isr_thread(). Replace calls to ipa_clock_get() there calling pm_runtime_get_sync() instead. And call pm_runtime_put() there rather than ipa_clock_put(). Warn if we ever get an error. With that, we can get rid of ipa_clock_get() and ipa_clock_put(). Signed-off-by: Alex Elder <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 724c2d7 commit c3f115a

File tree

3 files changed

+7
-48
lines changed

3 files changed

+7
-48
lines changed

drivers/net/ipa/ipa_clock.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -272,23 +272,6 @@ static int ipa_runtime_idle(struct device *dev)
272272
return -EAGAIN;
273273
}
274274

275-
/* Get an IPA clock reference. If the reference count is non-zero, it is
276-
* incremented and return is immediate. Otherwise the IPA clock is
277-
* enabled.
278-
*/
279-
int ipa_clock_get(struct ipa *ipa)
280-
{
281-
return pm_runtime_get_sync(&ipa->pdev->dev);
282-
}
283-
284-
/* Attempt to remove an IPA clock reference. If this represents the
285-
* last reference, disable the IPA clock.
286-
*/
287-
int ipa_clock_put(struct ipa *ipa)
288-
{
289-
return pm_runtime_put(&ipa->pdev->dev);
290-
}
291-
292275
static int ipa_suspend(struct device *dev)
293276
{
294277
struct ipa *ipa = dev_get_drvdata(dev);

drivers/net/ipa/ipa_clock.h

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -70,28 +70,4 @@ struct ipa_clock *ipa_clock_init(struct device *dev,
7070
*/
7171
void ipa_clock_exit(struct ipa_clock *clock);
7272

73-
/**
74-
* ipa_clock_get() - Get an IPA clock reference
75-
* @ipa: IPA pointer
76-
*
77-
* Return: 0 if clock started, 1 if clock already running, or a negative
78-
* error code
79-
*
80-
* This call blocks if this is the first reference. A reference is
81-
* taken even if an error occurs starting the IPA clock.
82-
*/
83-
int ipa_clock_get(struct ipa *ipa);
84-
85-
/**
86-
* ipa_clock_put() - Drop an IPA clock reference
87-
* @ipa: IPA pointer
88-
*
89-
* Return: 0 if successful, or a negative error code
90-
*
91-
* This drops a clock reference. If the last reference is being dropped,
92-
* the clock is stopped and RX endpoints are suspended. This call will
93-
* not block unless the last reference is dropped.
94-
*/
95-
int ipa_clock_put(struct ipa *ipa);
96-
9773
#endif /* _IPA_CLOCK_H_ */

drivers/net/ipa/ipa_interrupt.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121

2222
#include <linux/types.h>
2323
#include <linux/interrupt.h>
24+
#include <linux/pm_runtime.h>
2425

2526
#include "ipa.h"
26-
#include "ipa_clock.h"
2727
#include "ipa_reg.h"
2828
#include "ipa_endpoint.h"
2929
#include "ipa_interrupt.h"
@@ -80,14 +80,16 @@ static irqreturn_t ipa_isr_thread(int irq, void *dev_id)
8080
struct ipa_interrupt *interrupt = dev_id;
8181
struct ipa *ipa = interrupt->ipa;
8282
u32 enabled = interrupt->enabled;
83+
struct device *dev;
8384
u32 pending;
8485
u32 offset;
8586
u32 mask;
8687
int ret;
8788

88-
ret = ipa_clock_get(ipa);
89+
dev = &ipa->pdev->dev;
90+
ret = pm_runtime_get_sync(dev);
8991
if (WARN_ON(ret < 0))
90-
goto out_clock_put;
92+
goto out_power_put;
9193

9294
/* The status register indicates which conditions are present,
9395
* including conditions whose interrupt is not enabled. Handle
@@ -108,15 +110,13 @@ static irqreturn_t ipa_isr_thread(int irq, void *dev_id)
108110

109111
/* If any disabled interrupts are pending, clear them */
110112
if (pending) {
111-
struct device *dev = &ipa->pdev->dev;
112-
113113
dev_dbg(dev, "clearing disabled IPA interrupts 0x%08x\n",
114114
pending);
115115
offset = ipa_reg_irq_clr_offset(ipa->version);
116116
iowrite32(pending, ipa->reg_virt + offset);
117117
}
118-
out_clock_put:
119-
(void)ipa_clock_put(ipa);
118+
out_power_put:
119+
(void)pm_runtime_put(dev);
120120

121121
return IRQ_HANDLED;
122122
}

0 commit comments

Comments
 (0)