linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/7] drivers/gpio: gpio-nomadik: Apply Device Tree bindings
Date: Fri, 18 May 2012 08:37:16 +0100	[thread overview]
Message-ID: <4FB5FC2C.8090903@linaro.org> (raw)
In-Reply-To: <20120517213342.41A773E0621@localhost>

On 17/05/12 22:33, Grant Likely wrote:
> On Fri, 13 Apr 2012 15:05:05 +0100, Lee Jones<lee.jones@linaro.org>  wrote:
>> Signed-off-by: Lee Jones<lee.jones@linaro.org>
>
> Looks pretty good to me.  A few comments below, but otherwise you can
> add my:
>
> Acked-by: Grant Likely<grant.likely@secretlab.ca>
>
> Does this need to be merged via the arm-soc tree?

It's already been merged.

>> +	if (np) {
>> +		pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
>
> devm_kzalloc()

Yep, I can do that. I'll submit a follow-up patch.

>> +		if (!pdata)
>> +			return -ENOMEM;
>> +
>> +		if (of_get_property(np, "supports-sleepmode", NULL))
>> +			pdata->supports_sleepmode = true;
>
> I believe these properties were going to be updated to add an
> "stericsson," prefix.

Yes, I made that change. Odd that it didn't make it.

I'll make the change.

>> +
>> +		if (of_property_read_u32(np, "gpio-bank",&dev->id)) {
>> +			dev_err(&dev->dev, "gpio-bank property not found\n");
>> +			ret = -EINVAL;
>> +			goto out_dt;
>> +		}
>> +
>> +		pdata->first_gpio = dev->id * NMK_GPIO_PER_CHIP;
>> +		pdata->num_gpio   = NMK_GPIO_PER_CHIP;
>> +	}
>>
>>   	res = platform_get_resource(dev, IORESOURCE_MEM, 0);
>>   	if (!res) {
>> @@ -1117,6 +1138,7 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
>>   		ret = -ENOMEM;
>>   		goto out_clk;
>>   	}
>> +
>
> Nit: unrelated whitespace change.

Okay, but it looks better now though, so I'll leave it if that's okay?

>>   	/*
>>   	 * The virt address in nmk_chip->addr is in the nomadik register space,
>>   	 * so we can simply convert the resource address, without remapping
>> @@ -1139,6 +1161,8 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
>>   	chip->dev =&dev->dev;
>>   	chip->owner = THIS_MODULE;
>>
>> +	chip->of_node = np;
>> +
>>   	ret = gpiochip_add(&nmk_chip->chip);
>>   	if (ret)
>>   		goto out_free;
>> @@ -1146,12 +1170,13 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
>>   	BUG_ON(nmk_chip->bank>= ARRAY_SIZE(nmk_gpio_chips));
>>
>>   	nmk_gpio_chips[nmk_chip->bank] = nmk_chip;
>> +
>>   	platform_set_drvdata(dev, nmk_chip);
>>
>>   	nmk_gpio_init_irq(nmk_chip);
>>
>> -	dev_info(&dev->dev, "at address %p\n",
>> -		 nmk_chip->addr);
>> +	dev_info(&dev->dev, "at address %p\n", nmk_chip->addr);
>> +
>
> Nit: unrelated change

As above.

>>   	return 0;
>>
>>   out_free:
>> @@ -1164,13 +1189,23 @@ out_release:
>>   out:
>>   	dev_err(&dev->dev, "Failure %i for GPIO %i-%i\n", ret,
>>   		  pdata->first_gpio, pdata->first_gpio+31);
>> +out_dt:
>> +	if (np)
>> +		kfree(pdata);
>> +
>>   	return ret;
>>   }
>>
>> +static const struct of_device_id nmk_gpio_match[] = {
>> +	{ .compatible = "st,nomadik-gpio", },
>> +	{}
>> +};
>> +
>>   static struct platform_driver nmk_gpio_driver = {
>>   	.driver = {
>>   		.owner = THIS_MODULE,
>>   		.name = "gpio",
>> +		.of_match_table = nmk_gpio_match,
>>   	},
>>   	.probe = nmk_gpio_probe,
>>   };
>> --
>> 1.7.9.1
>>
>


-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
M: +44 77 88 633 515
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2012-05-18  7:37 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-13 14:05 [PATCH 0/7 v2] Next round of DT enablement for ux500/Snowball Lee Jones
2012-04-13 14:05 ` [PATCH 1/7] ARM: ux500: Rename the DT compatible entry for i2c devices on Snowball Lee Jones
2012-04-16  8:34   ` Linus Walleij
2012-04-13 14:05 ` [PATCH 2/7] ARM: ux500: Shorten Snowball's DT compatible gpio entry Lee Jones
2012-04-16  8:36   ` Linus Walleij
2012-04-16  9:00     ` Lee Jones
2012-04-13 14:05 ` [PATCH 3/7] drivers/gpio: gpio-nomadik: Apply Device Tree bindings Lee Jones
2012-04-16  8:40   ` Linus Walleij
2012-05-17 21:33   ` Grant Likely
2012-05-18  7:37     ` Lee Jones [this message]
2012-04-13 14:05 ` [PATCH 4/7] drivers/gpio: gpio-nomadik: Provide documentation for " Lee Jones
2012-04-13 14:59   ` Lee Jones
2012-04-16  8:43     ` Linus Walleij
2012-04-13 14:05 ` [PATCH 5/7] ARM: ux500: Rename gpio_keys in the Device Tree file Lee Jones
2012-04-13 14:05 ` [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants Lee Jones
2012-04-13 14:42   ` Pawel Moll
2012-04-13 14:51     ` Arnd Bergmann
2012-04-13 14:54       ` Lee Jones
2012-04-13 15:05         ` Pawel Moll
2012-04-13 15:16           ` Lee Jones
2012-04-13 15:27             ` Pawel Moll
2012-04-16  8:48   ` Linus Walleij
2012-04-16  9:06     ` Lee Jones
2012-04-16  9:18       ` Linus Walleij
2012-04-16  9:25     ` [PATCH 6.1/7] ARM: ux500: Enable Device Tree support mmci for Snowball Lee Jones
2012-04-16  9:26     ` [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500 Lee Jones
2012-04-25 18:57       ` Russell King - ARM Linux
2012-04-30  8:25         ` Lee Jones
2012-05-03 15:03         ` Lee Jones
2012-05-03 15:12           ` Russell King - ARM Linux
2012-05-03 15:18             ` Lee Jones
2012-05-03 15:30             ` Lee Jones
2012-05-03 16:30               ` Russell King - ARM Linux
2012-05-03 16:38                 ` Lee Jones
2012-05-03 16:45                   ` Russell King - ARM Linux
2012-05-03 16:59                     ` Lee Jones
2012-05-03 17:13                       ` Mark Brown
2012-05-03 21:21                         ` Lee Jones
2012-05-03 17:09                     ` Chris Ball
2012-05-04 13:18                       ` Lee Jones
2012-05-04 13:26                         ` Chris Ball
2012-05-04 13:39                           ` Lee Jones
2012-05-07 22:00                             ` Paul Gortmaker
2012-05-08 11:19                               ` Lee Jones
2012-05-08 12:18                                 ` Chris Ball
2012-05-08 12:59                                   ` Lee Jones
2012-05-08 14:38                                     ` Chris Ball
2012-05-08 23:58                                     ` Paul Gortmaker
2012-05-09  0:29                                       ` Chris Ball
2012-05-09  0:52                                         ` Paul Gortmaker
2012-06-04 10:14       ` Russell King - ARM Linux
2012-06-05 10:47         ` Lee Jones
2012-06-05 10:52           ` Russell King - ARM Linux
2012-06-05 12:59             ` Linus Walleij
2012-06-06  8:09               ` Lee Jones
2012-06-11 10:03               ` Lee Jones
2012-06-11 10:34                 ` Linus Walleij
2012-04-13 14:05 ` [PATCH 7/7] MMC: mmci: Add required documentation for Device Tree bindings Lee Jones
2012-04-18 14:31   ` Pawel Moll
2012-04-18 15:01     ` Pawel Moll
2012-04-18 15:12     ` Lee Jones
2012-04-18 15:20       ` Chris Ball
2012-04-18 15:25         ` Lee Jones
2012-04-18 15:20   ` [PATCH 7/7 v2] " Lee Jones
2012-05-17 21:23   ` [PATCH 7/7] " Grant Likely
2012-04-13 14:21 ` [PATCH 0/7 v2] Next round of DT enablement for ux500/Snowball Arnd Bergmann
  -- strict thread matches above, loose matches on Subject: below --
2012-04-05 10:25 [PATCH 1/7] ARM: ux500: New DT:ed snowball_platform_devs for one-by-one device enablement Lee Jones
2012-04-05 10:25 ` [PATCH 3/7] drivers/gpio: gpio-nomadik: Apply Device Tree bindings Lee Jones
2012-04-05  9:55 [0/7] Next round of DT enablement for ux500/Snowball Lee Jones
2012-04-05  9:55 ` [PATCH 3/7] drivers/gpio: gpio-nomadik: Apply Device Tree bindings Lee Jones
2012-04-10  9:14   ` Linus Walleij
2012-04-10  9:19     ` Linus Walleij

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=4FB5FC2C.8090903@linaro.org \
    --to=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).