From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2 2/2] sunxi: gpio: convert bind() to use driver data
Date: Thu, 12 May 2016 11:50:23 -0600 [thread overview]
Message-ID: <5734C25F.3040307@wwwdotorg.org> (raw)
In-Reply-To: <CAPnjgZ00Lps6w9=RugUFaH41ZB49fZErwJdXf8MW+_A-8OkAiA@mail.gmail.com>
On 05/12/2016 11:43 AM, Simon Glass wrote:
> Hi Stephen,
>
> On 11 May 2016 at 15:26, Stephen Warren <swarren@wwwdotorg.org> wrote:
>> From: Stephen Warren <swarren@nvidia.com>
>>
>> Now that the DM core sets driver_data before calling bind(), this driver
>> can make use of driver_data to determine the set of child devices to
>> create, rather than manually re-implementing the matching logic in code.
>> diff --git a/drivers/gpio/sunxi_gpio.c b/drivers/gpio/sunxi_gpio.c
>> +#define ID(_compat_, _soc_data_) \
>> + { .compatible = _compat_, .data = (ulong)&soc_data_##_soc_data_ }
>> +
>> static const struct udevice_id sunxi_gpio_ids[] = {
>> - { .compatible = "allwinner,sun4i-a10-pinctrl" },
>> - { .compatible = "allwinner,sun5i-a10s-pinctrl" },
>> - { .compatible = "allwinner,sun5i-a13-pinctrl" },
...
>> + ID("allwinner,sun4i-a10-pinctrl", a_all),
>> + ID("allwinner,sun5i-a10s-pinctrl", a_all),
>
> I don't think the #define adds a lot of value - consider removing it
> an writing things out in full?
I originally did that, but you either end up with lines over 80 columns
which checkpatch complains about, or multiple lines per entry which
makes it harder to read for such a large table. Still, I can convert it
if you want.
next prev parent reply other threads:[~2016-05-12 17:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-11 21:26 [U-Boot] [PATCH V2 1/2] dm: allow setting driver_data before/during bind Stephen Warren
2016-05-11 21:26 ` [U-Boot] [PATCH V2 2/2] sunxi: gpio: convert bind() to use driver data Stephen Warren
2016-05-12 17:43 ` Simon Glass
2016-05-12 17:50 ` Stephen Warren [this message]
2016-05-12 17:51 ` Simon Glass
2016-05-12 17:51 ` Hans de Goede
2016-05-13 2:42 ` Simon Glass
2016-05-23 15:39 ` Simon Glass
2016-05-12 17:43 ` [U-Boot] [PATCH V2 1/2] dm: allow setting driver_data before/during bind Simon Glass
2016-05-23 15:38 ` Simon Glass
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=5734C25F.3040307@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=u-boot@lists.denx.de \
/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: link
Be 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.