From: Mark Brown <broonie@opensource.wolfsonmicro.com> To: "Ying-Chun Liu (PaulLiu)" <paul.liu@linaro.org> Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linaro-dev@lists.linaro.org, patches@linaro.org, Samuel Ortiz <sameo@linux.intel.com>, Shawn Guo <shawn.guo@linaro.org>, Ashish Jangam <ashish.jangam@kpitcummins.com> Subject: Re: [PATCH 1/2] mfd: da9052: add device-tree support for i2c driver Date: Thu, 12 Apr 2012 16:53:41 +0100 [thread overview] Message-ID: <20120412155341.GB3195@opensource.wolfsonmicro.com> (raw) In-Reply-To: <1334245182-31725-1-git-send-email-paul.liu@linaro.org> [-- Attachment #1: Type: text/plain, Size: 1141 bytes --] On Thu, Apr 12, 2012 at 11:39:41PM +0800, Ying-Chun Liu (PaulLiu) wrote: > +- compatible : Should be "dialog,da9052", "dialog,da9053-aa", > + "dialog,da9053-ab", or "dialog,da9053-bb" This is generally the stock ticker symbol so DLG for Dialog. > +Sub-nodes: > +- regulators : Contain the regulator nodes. The DA9052 regulators are > + sorted as following: This seems poor from a usability point of view, the user shouldn't have to care about the order in which they list things in their device tree and they should be able to only list the regulators they use. > + buck_core : regulator BUCK_CORE (id: 0 ) Having to care about numeric IDs also seems bad for usability. > +#ifdef CONFIG_OF > + if (!id) { > + int i; > + struct device_node *np = client->dev.of_node; > + > + for (i = 0; > + i < sizeof(dialog_dt_ids)/sizeof(dialog_dt_ids[0]); > + i++) > + if (of_device_is_compatible(np, > + dialog_dt_ids[i].compatible)) > + id = &da9052_i2c_id[i]; > + } > +#endif Ick, this doesn't look terribly nice - are you sure this is idiomatic? The bound for the iteration also looks a lot like ARRAY_SIZE(). [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 836 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: broonie@opensource.wolfsonmicro.com (Mark Brown) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] mfd: da9052: add device-tree support for i2c driver Date: Thu, 12 Apr 2012 16:53:41 +0100 [thread overview] Message-ID: <20120412155341.GB3195@opensource.wolfsonmicro.com> (raw) In-Reply-To: <1334245182-31725-1-git-send-email-paul.liu@linaro.org> On Thu, Apr 12, 2012 at 11:39:41PM +0800, Ying-Chun Liu (PaulLiu) wrote: > +- compatible : Should be "dialog,da9052", "dialog,da9053-aa", > + "dialog,da9053-ab", or "dialog,da9053-bb" This is generally the stock ticker symbol so DLG for Dialog. > +Sub-nodes: > +- regulators : Contain the regulator nodes. The DA9052 regulators are > + sorted as following: This seems poor from a usability point of view, the user shouldn't have to care about the order in which they list things in their device tree and they should be able to only list the regulators they use. > + buck_core : regulator BUCK_CORE (id: 0 ) Having to care about numeric IDs also seems bad for usability. > +#ifdef CONFIG_OF > + if (!id) { > + int i; > + struct device_node *np = client->dev.of_node; > + > + for (i = 0; > + i < sizeof(dialog_dt_ids)/sizeof(dialog_dt_ids[0]); > + i++) > + if (of_device_is_compatible(np, > + dialog_dt_ids[i].compatible)) > + id = &da9052_i2c_id[i]; > + } > +#endif Ick, this doesn't look terribly nice - are you sure this is idiomatic? The bound for the iteration also looks a lot like ARRAY_SIZE(). -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120412/a3724d25/attachment.sig>
next prev parent reply other threads:[~2012-04-12 15:53 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-04-12 15:39 [PATCH 1/2] mfd: da9052: add device-tree support for i2c driver Ying-Chun Liu (PaulLiu) 2012-04-12 15:39 ` Ying-Chun Liu (PaulLiu) 2012-04-12 15:39 ` [PATCH 2/2] regulator: da9052: add device tree support Ying-Chun Liu (PaulLiu) 2012-04-12 15:39 ` Ying-Chun Liu (PaulLiu) 2012-04-12 15:59 ` Mark Brown 2012-04-12 15:59 ` Mark Brown 2012-04-12 15:53 ` Mark Brown [this message] 2012-04-12 15:53 ` [PATCH 1/2] mfd: da9052: add device-tree support for i2c driver Mark Brown
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20120412155341.GB3195@opensource.wolfsonmicro.com \ --to=broonie@opensource.wolfsonmicro.com \ --cc=ashish.jangam@kpitcummins.com \ --cc=linaro-dev@lists.linaro.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=patches@linaro.org \ --cc=paul.liu@linaro.org \ --cc=sameo@linux.intel.com \ --cc=shawn.guo@linaro.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.