Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1287203
| From | Sascha Hauer <s.hauer@pengutronix.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC][PATCH] misc: Introduce reboot_reason driver |
| Date | 2015-12-09 10:00 +0100 |
| Message-ID | <qDILo-65j-13@gated-at.bofh.it> (permalink) |
| References | <qDxZD-7Cj-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi John,
Only a small comment
On Tue, Dec 08, 2015 at 01:29:22PM -0800, John Stultz wrote:
> +static int reboot_reason_probe(struct platform_device *pdev)
> +{
> + struct resource *res;
> + u32 val;
> + int i;
> +
> + /* initialize the reasons */
> + for (i = 0; i < MAX_REASONS; i++)
> + reasons[i] = -1;
> +
> + /* Try to grab the reason io address */
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + reboot_reason_addr = devm_ioremap_resource(&pdev->dev, res);
> + if (IS_ERR(reboot_reason_addr))
> + return PTR_ERR(reboot_reason_addr);
> +
> + /* initialize specified reasons from DT */
> + if (!of_property_read_u32(pdev->dev.of_node, "reason,none", &val))
> + reasons[NONE] = val;
can be simplified to:
of_property_read_u32(pdev->dev.of_node, "reason,none", &reasons[NONE]);
No need to check first, &reasons[NONE] will only be modified when the
property exists.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC][PATCH] misc: Introduce reboot_reason driver John Stultz <john.stultz@linaro.org> - 2015-12-08 22:30 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver Arnd Bergmann <arnd@arndb.de> - 2015-12-08 23:00 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver Bjorn Andersson <bjorn.andersson@sonymobile.com> - 2015-12-08 23:20 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver Rob Herring <robh+dt@kernel.org> - 2015-12-08 23:50 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver John Stultz <john.stultz@linaro.org> - 2015-12-09 01:20 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver Sascha Hauer <s.hauer@pengutronix.de> - 2015-12-09 10:00 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver John Stultz <john.stultz@linaro.org> - 2015-12-09 22:50 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver Bjorn Andersson <bjorn.andersson@sonymobile.com> - 2015-12-08 23:10 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver John Stultz <john.stultz@linaro.org> - 2015-12-09 01:30 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver Arnd Bergmann <arnd@arndb.de> - 2015-12-09 11:10 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver John Stultz <john.stultz@linaro.org> - 2015-12-10 02:30 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver Arnd Bergmann <arnd@arndb.de> - 2015-12-10 16:00 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver John Stultz <john.stultz@linaro.org> - 2015-12-10 20:00 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver Rob Herring <robh+dt@kernel.org> - 2015-12-10 21:30 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver John Stultz <john.stultz@linaro.org> - 2015-12-10 22:50 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver Arnd Bergmann <arnd@arndb.de> - 2015-12-10 23:20 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver John Stultz <john.stultz@linaro.org> - 2015-12-10 02:40 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver Arnd Bergmann <arnd@arndb.de> - 2015-12-10 10:10 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver Tomas Winkler <tomasw@gmail.com> - 2015-12-10 10:30 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver John Stultz <john.stultz@linaro.org> - 2015-12-10 20:10 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2015-12-10 21:00 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver John Stultz <john.stultz@linaro.org> - 2015-12-10 21:10 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver Rob Herring <robh+dt@kernel.org> - 2015-12-08 23:30 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver John Stultz <john.stultz@linaro.org> - 2015-12-09 01:40 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver Sascha Hauer <s.hauer@pengutronix.de> - 2015-12-09 10:00 +0100
Re: [RFC][PATCH] misc: Introduce reboot_reason driver Sascha Hauer <s.hauer@pengutronix.de> - 2015-12-09 10:10 +0100
csiph-web