Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1272286
| From | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v3 2/5] mfd: syscon: add a DT property to set value width |
| Date | 2015-11-18 16:20 +0100 |
| Message-ID | <qwcGC-4D5-23@gated-at.bofh.it> (permalink) |
| References | <qvxtL-2U5-13@gated-at.bofh.it> <qvxtM-2U5-27@gated-at.bofh.it> <qvKKl-397-1@gated-at.bofh.it> <qvSeS-81H-13@gated-at.bofh.it> <qw6hQ-nn-21@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 11/18/2015 12:21 AM, Lee Jones wrote: [ ... ] >>> Or, for more clarity: >>> >>> of_property_read_u32(np, "bus-width", &bus_width); >>> if (bus_width) >>> >>> If you choose this version (which I think is my preferred method, don't >>> forget to initialise 'bus_width' to zero. >>> >> Ignoring an error and depending on bus_width==0 to determine if the property >> was provided seems odd, especially since it would "hide" if the bus-width >> property is set to 0. In the original code, this would be detected as error. > > I'm not sure what you mean. If bus_width==0, then a problem has > occurred and we will not use the value. If bus_width!=0 then we can > assume that it's been set and (as the comment describes) the value > will be checked for errors in regmap_init_mmio(). > Your proposed code does not distinguish a missing property from "bus-width = <0>;". It will silently ignore this case. Guenter -- 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
[PATCH v3 2/5] mfd: syscon: add a DT property to set value width Damien Riegel <damien.riegel@savoirfairelinux.com> - 2015-11-16 20:20 +0100
Re: [PATCH v3 2/5] mfd: syscon: add a DT property to set value width Lee Jones <lee.jones@linaro.org> - 2015-11-17 10:30 +0100
Re: [PATCH v3 2/5] mfd: syscon: add a DT property to set value width Lee Jones <lee.jones@linaro.org> - 2015-11-17 10:30 +0100
Re: [PATCH v3 2/5] mfd: syscon: add a DT property to set value width Guenter Roeck <linux@roeck-us.net> - 2015-11-17 18:30 +0100
Re: [PATCH v3 2/5] mfd: syscon: add a DT property to set value width Lee Jones <lee.jones@linaro.org> - 2015-11-18 09:30 +0100
Re: [PATCH v3 2/5] mfd: syscon: add a DT property to set value width Guenter Roeck <linux@roeck-us.net> - 2015-11-18 16:20 +0100
Re: [PATCH v3 2/5] mfd: syscon: add a DT property to set value width Lee Jones <lee.jones@linaro.org> - 2015-11-18 16:30 +0100
Re: [PATCH v3 2/5] mfd: syscon: add a DT property to set value width Arnd Bergmann <arnd@arndb.de> - 2015-11-21 00:20 +0100
Re: [PATCH v3 2/5] mfd: syscon: add a DT property to set value width Lee Jones <lee.jones@linaro.org> - 2015-11-23 09:30 +0100
csiph-web