Commit b33f3706 authored by Stephen Boyd's avatar Stephen Boyd Committed by Greg Kroah-Hartman

usb: Remove dev_err() usage after platform_get_irq()

We don't need dev_err() messages when platform_get_irq() fails now that
platform_get_irq() prints an error message itself when something goes
wrong. Let's remove these prints with a simple semantic patch.

// <smpl>
@@
expression ret;
struct platform_device *E;
@@

ret =
(
platform_get_irq(E, ...)
|
platform_get_irq_byname(E, ...)
);

if ( \( ret < 0 \| ret <= 0 \) )
{
(
-if (ret != -EPROBE_DEFER)
-{ ...
-dev_err(...);
-... }
|
...
-dev_err(...);
)
...
}
// </smpl>

While we're here, remove braces on if statements that only have one
statement (manually).
Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20190730181557.90391-47-swboyd@chromium.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dcf8f7ec
...@@ -1008,7 +1008,6 @@ static int ci_hdrc_probe(struct platform_device *pdev) ...@@ -1008,7 +1008,6 @@ static int ci_hdrc_probe(struct platform_device *pdev)
ci->irq = platform_get_irq(pdev, 0); ci->irq = platform_get_irq(pdev, 0);
if (ci->irq < 0) { if (ci->irq < 0) {
dev_err(dev, "missing IRQ\n");
ret = ci->irq; ret = ci->irq;
goto deinit_phy; goto deinit_phy;
} }
......
...@@ -407,10 +407,8 @@ static int dwc2_driver_probe(struct platform_device *dev) ...@@ -407,10 +407,8 @@ static int dwc2_driver_probe(struct platform_device *dev)
spin_lock_init(&hsotg->lock); spin_lock_init(&hsotg->lock);
hsotg->irq = platform_get_irq(dev, 0); hsotg->irq = platform_get_irq(dev, 0);
if (hsotg->irq < 0) { if (hsotg->irq < 0)
dev_err(&dev->dev, "missing IRQ resource\n");
return hsotg->irq; return hsotg->irq;
}
dev_dbg(hsotg->dev, "registering common handler for irq%d\n", dev_dbg(hsotg->dev, "registering common handler for irq%d\n",
hsotg->irq); hsotg->irq);
......
...@@ -112,7 +112,6 @@ static int kdwc3_probe(struct platform_device *pdev) ...@@ -112,7 +112,6 @@ static int kdwc3_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0) {
dev_err(&pdev->dev, "missing irq\n");
error = irq; error = irq;
goto err_irq; goto err_irq;
} }
......
...@@ -469,10 +469,8 @@ static int dwc3_omap_probe(struct platform_device *pdev) ...@@ -469,10 +469,8 @@ static int dwc3_omap_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, omap); platform_set_drvdata(pdev, omap);
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(dev, "missing IRQ resource: %d\n", irq);
return irq; return irq;
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
base = devm_ioremap_resource(dev, res); base = devm_ioremap_resource(dev, res);
......
...@@ -348,7 +348,6 @@ static int ast_vhub_probe(struct platform_device *pdev) ...@@ -348,7 +348,6 @@ static int ast_vhub_probe(struct platform_device *pdev)
/* Find interrupt and install handler */ /* Find interrupt and install handler */
vhub->irq = platform_get_irq(pdev, 0); vhub->irq = platform_get_irq(pdev, 0);
if (vhub->irq < 0) { if (vhub->irq < 0) {
dev_err(&pdev->dev, "Failed to get interrupt\n");
rc = vhub->irq; rc = vhub->irq;
goto err; goto err;
} }
......
...@@ -2328,10 +2328,8 @@ static int bcm63xx_udc_probe(struct platform_device *pdev) ...@@ -2328,10 +2328,8 @@ static int bcm63xx_udc_probe(struct platform_device *pdev)
/* IRQ resource #0: control interrupt (VBUS, speed, etc.) */ /* IRQ resource #0: control interrupt (VBUS, speed, etc.) */
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(dev, "missing IRQ resource #0\n");
goto out_uninit; goto out_uninit;
}
if (devm_request_irq(dev, irq, &bcm63xx_udc_ctrl_isr, 0, if (devm_request_irq(dev, irq, &bcm63xx_udc_ctrl_isr, 0,
dev_name(dev), udc) < 0) dev_name(dev), udc) < 0)
goto report_request_failure; goto report_request_failure;
...@@ -2339,10 +2337,8 @@ static int bcm63xx_udc_probe(struct platform_device *pdev) ...@@ -2339,10 +2337,8 @@ static int bcm63xx_udc_probe(struct platform_device *pdev)
/* IRQ resources #1-6: data interrupts for IUDMA channels 0-5 */ /* IRQ resources #1-6: data interrupts for IUDMA channels 0-5 */
for (i = 0; i < BCM63XX_NUM_IUDMA; i++) { for (i = 0; i < BCM63XX_NUM_IUDMA; i++) {
irq = platform_get_irq(pdev, i + 1); irq = platform_get_irq(pdev, i + 1);
if (irq < 0) { if (irq < 0)
dev_err(dev, "missing IRQ resource #%d\n", i + 1);
goto out_uninit; goto out_uninit;
}
if (devm_request_irq(dev, irq, &bcm63xx_udc_data_isr, 0, if (devm_request_irq(dev, irq, &bcm63xx_udc_data_isr, 0,
dev_name(dev), &udc->iudma[i]) < 0) dev_name(dev), &udc->iudma[i]) < 0)
goto report_request_failure; goto report_request_failure;
......
...@@ -515,10 +515,8 @@ static int bdc_probe(struct platform_device *pdev) ...@@ -515,10 +515,8 @@ static int bdc_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
} }
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(dev, "platform_get_irq failed:%d\n", irq);
return irq; return irq;
}
spin_lock_init(&bdc->lock); spin_lock_init(&bdc->lock);
platform_set_drvdata(pdev, bdc); platform_set_drvdata(pdev, bdc);
bdc->irq = irq; bdc->irq = irq;
......
...@@ -2134,19 +2134,15 @@ static int gr_probe(struct platform_device *pdev) ...@@ -2134,19 +2134,15 @@ static int gr_probe(struct platform_device *pdev)
return PTR_ERR(regs); return PTR_ERR(regs);
dev->irq = platform_get_irq(pdev, 0); dev->irq = platform_get_irq(pdev, 0);
if (dev->irq <= 0) { if (dev->irq <= 0)
dev_err(dev->dev, "No irq found\n");
return -ENODEV; return -ENODEV;
}
/* Some core configurations has separate irqs for IN and OUT events */ /* Some core configurations has separate irqs for IN and OUT events */
dev->irqi = platform_get_irq(pdev, 1); dev->irqi = platform_get_irq(pdev, 1);
if (dev->irqi > 0) { if (dev->irqi > 0) {
dev->irqo = platform_get_irq(pdev, 2); dev->irqo = platform_get_irq(pdev, 2);
if (dev->irqo <= 0) { if (dev->irqo <= 0)
dev_err(dev->dev, "Found irqi but not irqo\n");
return -ENODEV; return -ENODEV;
}
} else { } else {
dev->irqi = 0; dev->irqi = 0;
} }
......
...@@ -3061,12 +3061,9 @@ static int lpc32xx_udc_probe(struct platform_device *pdev) ...@@ -3061,12 +3061,9 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)
/* Get IRQs */ /* Get IRQs */
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
udc->udp_irq[i] = platform_get_irq(pdev, i); udc->udp_irq[i] = platform_get_irq(pdev, i);
if (udc->udp_irq[i] < 0) { if (udc->udp_irq[i] < 0)
dev_err(udc->dev,
"irq resource %d not available!\n", i);
return udc->udp_irq[i]; return udc->udp_irq[i];
} }
}
udc->udp_baseaddr = devm_ioremap_resource(dev, res); udc->udp_baseaddr = devm_ioremap_resource(dev, res);
if (IS_ERR(udc->udp_baseaddr)) { if (IS_ERR(udc->udp_baseaddr)) {
......
...@@ -2743,10 +2743,8 @@ static int renesas_usb3_probe(struct platform_device *pdev) ...@@ -2743,10 +2743,8 @@ static int renesas_usb3_probe(struct platform_device *pdev)
priv = of_device_get_match_data(&pdev->dev); priv = of_device_get_match_data(&pdev->dev);
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "Failed to get IRQ: %d\n", irq);
return irq; return irq;
}
usb3 = devm_kzalloc(&pdev->dev, sizeof(*usb3), GFP_KERNEL); usb3 = devm_kzalloc(&pdev->dev, sizeof(*usb3), GFP_KERNEL);
if (!usb3) if (!usb3)
......
...@@ -1311,10 +1311,8 @@ static int s3c_hsudc_probe(struct platform_device *pdev) ...@@ -1311,10 +1311,8 @@ static int s3c_hsudc_probe(struct platform_device *pdev)
s3c_hsudc_setup_ep(hsudc); s3c_hsudc_setup_ep(hsudc);
ret = platform_get_irq(pdev, 0); ret = platform_get_irq(pdev, 0);
if (ret < 0) { if (ret < 0)
dev_err(dev, "unable to obtain IRQ number\n");
goto err_res; goto err_res;
}
hsudc->irq = ret; hsudc->irq = ret;
ret = devm_request_irq(&pdev->dev, hsudc->irq, s3c_hsudc_irq, 0, ret = devm_request_irq(&pdev->dev, hsudc->irq, s3c_hsudc_irq, 0,
......
...@@ -2074,10 +2074,8 @@ static int xudc_probe(struct platform_device *pdev) ...@@ -2074,10 +2074,8 @@ static int xudc_probe(struct platform_device *pdev)
return PTR_ERR(udc->addr); return PTR_ERR(udc->addr);
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "unable to get irq\n");
return irq; return irq;
}
ret = devm_request_irq(&pdev->dev, irq, xudc_irq, 0, ret = devm_request_irq(&pdev->dev, irq, xudc_irq, 0,
dev_name(&pdev->dev), udc); dev_name(&pdev->dev), udc);
if (ret < 0) { if (ret < 0) {
......
...@@ -100,9 +100,6 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev) ...@@ -100,9 +100,6 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq <= 0) { if (irq <= 0) {
dev_err(&pdev->dev,
"Found HC with no IRQ. Check %s setup!\n",
dev_name(&pdev->dev));
retval = -ENODEV; retval = -ENODEV;
goto fail_create_hcd; goto fail_create_hcd;
} }
......
...@@ -115,10 +115,8 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) ...@@ -115,10 +115,8 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
} }
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(dev, "EHCI irq failed: %d\n", irq);
return irq; return irq;
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
regs = devm_ioremap_resource(dev, res); regs = devm_ioremap_resource(dev, res);
......
...@@ -223,9 +223,6 @@ static int ehci_orion_drv_probe(struct platform_device *pdev) ...@@ -223,9 +223,6 @@ static int ehci_orion_drv_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq <= 0) { if (irq <= 0) {
dev_err(&pdev->dev,
"Found HC with no IRQ. Check %s setup!\n",
dev_name(&pdev->dev));
err = -ENODEV; err = -ENODEV;
goto err; goto err;
} }
......
...@@ -145,10 +145,8 @@ static int ehci_platform_probe(struct platform_device *dev) ...@@ -145,10 +145,8 @@ static int ehci_platform_probe(struct platform_device *dev)
} }
irq = platform_get_irq(dev, 0); irq = platform_get_irq(dev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&dev->dev, "no irq provided");
return irq; return irq;
}
hcd = usb_create_hcd(&ehci_platform_hc_driver, &dev->dev, hcd = usb_create_hcd(&ehci_platform_hc_driver, &dev->dev,
dev_name(&dev->dev)); dev_name(&dev->dev));
......
...@@ -85,9 +85,6 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev) ...@@ -85,9 +85,6 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq <= 0) { if (irq <= 0) {
dev_err(&pdev->dev,
"Found HC with no IRQ. Check %s setup!\n",
dev_name(&pdev->dev));
ret = -ENODEV; ret = -ENODEV;
goto fail_create_hcd; goto fail_create_hcd;
} }
......
...@@ -158,10 +158,8 @@ static int st_ehci_platform_probe(struct platform_device *dev) ...@@ -158,10 +158,8 @@ static int st_ehci_platform_probe(struct platform_device *dev)
return -ENODEV; return -ENODEV;
irq = platform_get_irq(dev, 0); irq = platform_get_irq(dev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&dev->dev, "no irq provided");
return irq; return irq;
}
res_mem = platform_get_resource(dev, IORESOURCE_MEM, 0); res_mem = platform_get_resource(dev, IORESOURCE_MEM, 0);
if (!res_mem) { if (!res_mem) {
dev_err(&dev->dev, "no memory resource provided"); dev_err(&dev->dev, "no memory resource provided");
......
...@@ -1836,10 +1836,8 @@ static int imx21_probe(struct platform_device *pdev) ...@@ -1836,10 +1836,8 @@ static int imx21_probe(struct platform_device *pdev)
if (!res) if (!res)
return -ENODEV; return -ENODEV;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "Failed to get IRQ: %d\n", irq);
return irq; return irq;
}
hcd = usb_create_hcd(&imx21_hc_driver, hcd = usb_create_hcd(&imx21_hc_driver,
&pdev->dev, dev_name(&pdev->dev)); &pdev->dev, dev_name(&pdev->dev));
......
...@@ -111,10 +111,8 @@ static int ohci_platform_probe(struct platform_device *dev) ...@@ -111,10 +111,8 @@ static int ohci_platform_probe(struct platform_device *dev)
return err; return err;
irq = platform_get_irq(dev, 0); irq = platform_get_irq(dev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&dev->dev, "no irq provided");
return irq; return irq;
}
hcd = usb_create_hcd(&ohci_platform_hc_driver, &dev->dev, hcd = usb_create_hcd(&ohci_platform_hc_driver, &dev->dev,
dev_name(&dev->dev)); dev_name(&dev->dev));
......
...@@ -138,10 +138,8 @@ static int st_ohci_platform_probe(struct platform_device *dev) ...@@ -138,10 +138,8 @@ static int st_ohci_platform_probe(struct platform_device *dev)
return -ENODEV; return -ENODEV;
irq = platform_get_irq(dev, 0); irq = platform_get_irq(dev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&dev->dev, "no irq provided");
return irq; return irq;
}
res_mem = platform_get_resource(dev, IORESOURCE_MEM, 0); res_mem = platform_get_resource(dev, IORESOURCE_MEM, 0);
if (!res_mem) { if (!res_mem) {
......
...@@ -835,10 +835,8 @@ int ssusb_gadget_init(struct ssusb_mtk *ssusb) ...@@ -835,10 +835,8 @@ int ssusb_gadget_init(struct ssusb_mtk *ssusb)
return -ENOMEM; return -ENOMEM;
mtu->irq = platform_get_irq(pdev, 0); mtu->irq = platform_get_irq(pdev, 0);
if (mtu->irq < 0) { if (mtu->irq < 0)
dev_err(dev, "fail to get irq number\n");
return mtu->irq; return mtu->irq;
}
dev_info(dev, "irq %d\n", mtu->irq); dev_info(dev, "irq %d\n", mtu->irq);
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mac"); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mac");
......
...@@ -718,10 +718,8 @@ static int ab8500_usb_irq_setup(struct platform_device *pdev, ...@@ -718,10 +718,8 @@ static int ab8500_usb_irq_setup(struct platform_device *pdev,
if (ab->flags & AB8500_USB_FLAG_USE_LINK_STATUS_IRQ) { if (ab->flags & AB8500_USB_FLAG_USE_LINK_STATUS_IRQ) {
irq = platform_get_irq_byname(pdev, "USB_LINK_STATUS"); irq = platform_get_irq_byname(pdev, "USB_LINK_STATUS");
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "Link status irq not found\n");
return irq; return irq;
}
err = devm_request_threaded_irq(&pdev->dev, irq, NULL, err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
ab8500_usb_link_status_irq, ab8500_usb_link_status_irq,
IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_ONESHOT, IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_ONESHOT,
...@@ -734,10 +732,8 @@ static int ab8500_usb_irq_setup(struct platform_device *pdev, ...@@ -734,10 +732,8 @@ static int ab8500_usb_irq_setup(struct platform_device *pdev,
if (ab->flags & AB8500_USB_FLAG_USE_ID_WAKEUP_IRQ) { if (ab->flags & AB8500_USB_FLAG_USE_ID_WAKEUP_IRQ) {
irq = platform_get_irq_byname(pdev, "ID_WAKEUP_F"); irq = platform_get_irq_byname(pdev, "ID_WAKEUP_F");
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "ID fall irq not found\n");
return irq; return irq;
}
err = devm_request_threaded_irq(&pdev->dev, irq, NULL, err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
ab8500_usb_disconnect_irq, ab8500_usb_disconnect_irq,
IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_ONESHOT, IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_ONESHOT,
...@@ -750,10 +746,8 @@ static int ab8500_usb_irq_setup(struct platform_device *pdev, ...@@ -750,10 +746,8 @@ static int ab8500_usb_irq_setup(struct platform_device *pdev,
if (ab->flags & AB8500_USB_FLAG_USE_VBUS_DET_IRQ) { if (ab->flags & AB8500_USB_FLAG_USE_VBUS_DET_IRQ) {
irq = platform_get_irq_byname(pdev, "VBUS_DET_F"); irq = platform_get_irq_byname(pdev, "VBUS_DET_F");
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "VBUS fall irq not found\n");
return irq; return irq;
}
err = devm_request_threaded_irq(&pdev->dev, irq, NULL, err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
ab8500_usb_disconnect_irq, ab8500_usb_disconnect_irq,
IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_ONESHOT, IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_ONESHOT,
......
...@@ -617,10 +617,8 @@ static int wcove_typec_probe(struct platform_device *pdev) ...@@ -617,10 +617,8 @@ static int wcove_typec_probe(struct platform_device *pdev)
wcove->regmap = pmic->regmap; wcove->regmap = pmic->regmap;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "Failed to get IRQ: %d\n", irq);
return irq; return irq;
}
irq = regmap_irq_get_virq(pmic->irq_chip_data_chgr, irq); irq = regmap_irq_get_virq(pmic->irq_chip_data_chgr, irq);
if (irq < 0) if (irq < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment