summaryrefslogtreecommitdiffstats
path: root/drivers/irqchip
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2019-05-27 08:04:10 -0400
committerMarc Zyngier <marc.zyngier@arm.com>2019-05-29 05:42:26 -0400
commit9ae48bc03b261b7a8101606bc6b780973bb076fa (patch)
tree760354d903d324d0f6bb2cdc307fd1e1cdb5f35c /drivers/irqchip
parent5adb6cd1cd1f5537b62d7b09c19c2fd4fe9abbb2 (diff)
irqchip/renesas-irqc: Add helper variable dev = &pdev->dev
The probe function uses "&pdev->dev" a lot, hence add a shorthand for that. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'drivers/irqchip')
-rw-r--r--drivers/irqchip/irq-renesas-irqc.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/irqchip/irq-renesas-irqc.c b/drivers/irqchip/irq-renesas-irqc.c
index 0955ffe12b32..3cc428ba495c 100644
--- a/drivers/irqchip/irq-renesas-irqc.c
+++ b/drivers/irqchip/irq-renesas-irqc.c
@@ -124,10 +124,11 @@ static irqreturn_t irqc_irq_handler(int irq, void *dev_id)
124 124
125static int irqc_probe(struct platform_device *pdev) 125static int irqc_probe(struct platform_device *pdev)
126{ 126{
127 struct device *dev = &pdev->dev;
128 const char *name = dev_name(dev);
127 struct irqc_priv *p; 129 struct irqc_priv *p;
128 struct resource *io; 130 struct resource *io;
129 struct resource *irq; 131 struct resource *irq;
130 const char *name = dev_name(&pdev->dev);
131 int ret; 132 int ret;
132 int k; 133 int k;
133 134
@@ -140,13 +141,13 @@ static int irqc_probe(struct platform_device *pdev)
140 p->pdev = pdev; 141 p->pdev = pdev;
141 platform_set_drvdata(pdev, p); 142 platform_set_drvdata(pdev, p);
142 143
143 pm_runtime_enable(&pdev->dev); 144 pm_runtime_enable(dev);
144 pm_runtime_get_sync(&pdev->dev); 145 pm_runtime_get_sync(dev);
145 146
146 /* get hold of manadatory IOMEM */ 147 /* get hold of manadatory IOMEM */
147 io = platform_get_resource(pdev, IORESOURCE_MEM, 0); 148 io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
148 if (!io) { 149 if (!io) {
149 dev_err(&pdev->dev, "not enough IOMEM resources\n"); 150 dev_err(dev, "not enough IOMEM resources\n");
150 ret = -EINVAL; 151 ret = -EINVAL;
151 goto err1; 152 goto err1;
152 } 153 }
@@ -164,7 +165,7 @@ static int irqc_probe(struct platform_device *pdev)
164 165
165 p->number_of_irqs = k; 166 p->number_of_irqs = k;
166 if (p->number_of_irqs < 1) { 167 if (p->number_of_irqs < 1) {
167 dev_err(&pdev->dev, "not enough IRQ resources\n"); 168 dev_err(dev, "not enough IRQ resources\n");
168 ret = -EINVAL; 169 ret = -EINVAL;
169 goto err1; 170 goto err1;
170 } 171 }
@@ -178,12 +179,11 @@ static int irqc_probe(struct platform_device *pdev)
178 179
179 p->cpu_int_base = p->iomem + IRQC_INT_CPU_BASE(0); /* SYS-SPI */ 180 p->cpu_int_base = p->iomem + IRQC_INT_CPU_BASE(0); /* SYS-SPI */
180 181
181 p->irq_domain = irq_domain_add_linear(pdev->dev.of_node, 182 p->irq_domain = irq_domain_add_linear(dev->of_node, p->number_of_irqs,
182 p->number_of_irqs,
183 &irq_generic_chip_ops, p); 183 &irq_generic_chip_ops, p);
184 if (!p->irq_domain) { 184 if (!p->irq_domain) {
185 ret = -ENXIO; 185 ret = -ENXIO;
186 dev_err(&pdev->dev, "cannot initialize irq domain\n"); 186 dev_err(dev, "cannot initialize irq domain\n");
187 goto err2; 187 goto err2;
188 } 188 }
189 189
@@ -191,7 +191,7 @@ static int irqc_probe(struct platform_device *pdev)
191 1, name, handle_level_irq, 191 1, name, handle_level_irq,
192 0, 0, IRQ_GC_INIT_NESTED_LOCK); 192 0, 0, IRQ_GC_INIT_NESTED_LOCK);
193 if (ret) { 193 if (ret) {
194 dev_err(&pdev->dev, "cannot allocate generic chip\n"); 194 dev_err(dev, "cannot allocate generic chip\n");
195 goto err3; 195 goto err3;
196 } 196 }
197 197
@@ -209,13 +209,13 @@ static int irqc_probe(struct platform_device *pdev)
209 for (k = 0; k < p->number_of_irqs; k++) { 209 for (k = 0; k < p->number_of_irqs; k++) {
210 if (request_irq(p->irq[k].requested_irq, irqc_irq_handler, 210 if (request_irq(p->irq[k].requested_irq, irqc_irq_handler,
211 0, name, &p->irq[k])) { 211 0, name, &p->irq[k])) {
212 dev_err(&pdev->dev, "failed to request IRQ\n"); 212 dev_err(dev, "failed to request IRQ\n");
213 ret = -ENOENT; 213 ret = -ENOENT;
214 goto err4; 214 goto err4;
215 } 215 }
216 } 216 }
217 217
218 dev_info(&pdev->dev, "driving %d irqs\n", p->number_of_irqs); 218 dev_info(dev, "driving %d irqs\n", p->number_of_irqs);
219 219
220 return 0; 220 return 0;
221err4: 221err4:
@@ -227,8 +227,8 @@ err3:
227err2: 227err2:
228 iounmap(p->iomem); 228 iounmap(p->iomem);
229err1: 229err1:
230 pm_runtime_put(&pdev->dev); 230 pm_runtime_put(dev);
231 pm_runtime_disable(&pdev->dev); 231 pm_runtime_disable(dev);
232 kfree(p); 232 kfree(p);
233err0: 233err0:
234 return ret; 234 return ret;