Subject: + drivers-rtc-rtc-omapc-remove-multiple-device-id-checks.patch added to -mm tree To: nsekhar@xxxxxx,a.zummo@xxxxxxxxxxxx,lokeshvutla@xxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Fri, 09 May 2014 13:27:52 -0700 The patch titled Subject: drivers/rtc/rtc-omap.c: remove multiple device id checks has been added to the -mm tree. Its filename is drivers-rtc-rtc-omapc-remove-multiple-device-id-checks.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/drivers-rtc-rtc-omapc-remove-multiple-device-id-checks.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/drivers-rtc-rtc-omapc-remove-multiple-device-id-checks.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Sekhar Nori <nsekhar@xxxxxx> Subject: drivers/rtc/rtc-omap.c: remove multiple device id checks Remove multiple superfluous device id checks. Since an id_table is present in the driver probe() should never encounter an empty device id entry. In case of OF style match, of_match_device() returns an matching entry. For paranoia sake, check for device id entry once and fail probe() if none is found. This is much better than checking for it multiple times. Signed-off-by: Sekhar Nori <nsekhar@xxxxxx> Cc: Alessandro Zummo <a.zummo@xxxxxxxxxxxx> Cc: Lokesh Vutla <lokeshvutla@xxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/rtc/rtc-omap.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff -puN drivers/rtc/rtc-omap.c~drivers-rtc-rtc-omapc-remove-multiple-device-id-checks drivers/rtc/rtc-omap.c --- a/drivers/rtc/rtc-omap.c~drivers-rtc-rtc-omapc-remove-multiple-device-id-checks +++ a/drivers/rtc/rtc-omap.c @@ -352,6 +352,12 @@ static int __init omap_rtc_probe(struct if (of_id) pdev->id_entry = of_id->data; + id_entry = platform_get_device_id(pdev); + if (!id_entry) { + dev_err(&pdev->dev, "no matching device entry\n"); + return -ENODEV; + } + omap_rtc_timer = platform_get_irq(pdev, 0); if (omap_rtc_timer <= 0) { pr_debug("%s: no update irq?\n", pdev->name); @@ -373,8 +379,7 @@ static int __init omap_rtc_probe(struct pm_runtime_enable(&pdev->dev); pm_runtime_get_sync(&pdev->dev); - id_entry = platform_get_device_id(pdev); - if (id_entry && (id_entry->driver_data & OMAP_RTC_HAS_KICKER)) { + if (id_entry->driver_data & OMAP_RTC_HAS_KICKER) { rtc_writel(KICK0_VALUE, OMAP_RTC_KICK0_REG); rtc_writel(KICK1_VALUE, OMAP_RTC_KICK1_REG); } @@ -452,7 +457,7 @@ static int __init omap_rtc_probe(struct return 0; fail0: - if (id_entry && (id_entry->driver_data & OMAP_RTC_HAS_KICKER)) + if (id_entry->driver_data & OMAP_RTC_HAS_KICKER) rtc_writel(0, OMAP_RTC_KICK0_REG); pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); @@ -469,7 +474,7 @@ static int __exit omap_rtc_remove(struct /* leave rtc running, but disable irqs */ rtc_write(0, OMAP_RTC_INTERRUPTS_REG); - if (id_entry && (id_entry->driver_data & OMAP_RTC_HAS_KICKER)) + if (id_entry->driver_data & OMAP_RTC_HAS_KICKER) rtc_writel(0, OMAP_RTC_KICK0_REG); /* Disable the clock/module */ _ Patches currently in -mm which might be from nsekhar@xxxxxx are drivers-rtc-rtc-omapc-remove-multiple-device-id-checks.patch drivers-rtc-rtc-omapc-use-bit-macro.patch drivers-rtc-rtc-omapc-add-support-for-enabling-32khz-clock.patch linux-next.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html