linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the arm-soc tree with the driver-core tree
@ 2012-11-29  5:03 Stephen Rothwell
  2012-11-29  5:17 ` Greg KH
  2012-11-29 22:59 ` Simon Guinot
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen Rothwell @ 2012-11-29  5:03 UTC (permalink / raw)
  To: Olof Johansson, Arnd Bergmann, linux-arm-kernel
  Cc: linux-next, linux-kernel, Bill Pemberton, Greg KH, Simon Guinot

[-- Attachment #1: Type: text/plain, Size: 2899 bytes --]

Hi all,

Today's linux-next merge of the arm-soc tree got a conflict in
drivers/leds/leds-ns2.c between commit 98ea1ea20cb7 ("leds: remove use of
__devinit") from the driver-core tree and commit 72052fcc1026 ("leds:
leds-ns2: add device tree binding") from the arm-soc tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/leds/leds-ns2.c
index bc6a0db,d64cc22..0000000
--- a/drivers/leds/leds-ns2.c
+++ b/drivers/leds/leds-ns2.c
@@@ -247,9 -260,67 +248,65 @@@ static void delete_ns2_led(struct ns2_l
  {
  	device_remove_file(led_dat->cdev.dev, &dev_attr_sata);
  	led_classdev_unregister(&led_dat->cdev);
 -	gpio_free(led_dat->cmd);
 -	gpio_free(led_dat->slow);
  }
  
+ #ifdef CONFIG_OF_GPIO
+ /*
+  * Translate OpenFirmware node properties into platform_data.
+  */
 -static int __devinit
++static int
+ ns2_leds_get_of_pdata(struct device *dev, struct ns2_led_platform_data *pdata)
+ {
+ 	struct device_node *np = dev->of_node;
+ 	struct device_node *child;
+ 	struct ns2_led *leds;
+ 	int num_leds = 0;
+ 	int i = 0;
+ 
+ 	num_leds = of_get_child_count(np);
+ 	if (!num_leds)
+ 		return -ENODEV;
+ 
+ 	leds = devm_kzalloc(dev, num_leds * sizeof(struct ns2_led),
+ 			    GFP_KERNEL);
+ 	if (!leds)
+ 		return -ENOMEM;
+ 
+ 	for_each_child_of_node(np, child) {
+ 		const char *string;
+ 		int ret;
+ 
+ 		ret = of_get_named_gpio(child, "cmd-gpio", 0);
+ 		if (ret < 0)
+ 			return ret;
+ 		leds[i].cmd = ret;
+ 		ret = of_get_named_gpio(child, "slow-gpio", 0);
+ 		if (ret < 0)
+ 			return ret;
+ 		leds[i].slow = ret;
+ 		ret = of_property_read_string(child, "label", &string);
+ 		leds[i].name = (ret == 0) ? string : child->name;
+ 		ret = of_property_read_string(child, "linux,default-trigger",
+ 					      &string);
+ 		if (ret == 0)
+ 			leds[i].default_trigger = string;
+ 
+ 		i++;
+ 	}
+ 
+ 	pdata->leds = leds;
+ 	pdata->num_leds = num_leds;
+ 
+ 	return 0;
+ }
+ 
+ static const struct of_device_id of_ns2_leds_match[] = {
+ 	{ .compatible = "lacie,ns2-leds", },
+ 	{},
+ };
+ #endif /* CONFIG_OF_GPIO */
+ 
 -static int __devinit ns2_led_probe(struct platform_device *pdev)
 +static int ns2_led_probe(struct platform_device *pdev)
  {
  	struct ns2_led_platform_data *pdata = pdev->dev.platform_data;
  	struct ns2_led_data *leds_data;
@@@ -296,10 -381,11 +367,11 @@@ static int ns2_led_remove(struct platfo
  
  static struct platform_driver ns2_led_driver = {
  	.probe		= ns2_led_probe,
 -	.remove		= __devexit_p(ns2_led_remove),
 +	.remove		= ns2_led_remove,
  	.driver		= {
- 		.name	= "leds-ns2",
- 		.owner	= THIS_MODULE,
+ 		.name		= "leds-ns2",
+ 		.owner		= THIS_MODULE,
+ 		.of_match_table	= of_match_ptr(of_ns2_leds_match),
  	},
  };
  

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: linux-next: manual merge of the arm-soc tree with the driver-core tree
  2012-11-29  5:03 linux-next: manual merge of the arm-soc tree with the driver-core tree Stephen Rothwell
@ 2012-11-29  5:17 ` Greg KH
  2012-11-29 22:59 ` Simon Guinot
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2012-11-29  5:17 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Olof Johansson, Arnd Bergmann, linux-arm-kernel, linux-next,
	linux-kernel, Bill Pemberton, Simon Guinot

On Thu, Nov 29, 2012 at 04:03:09PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the arm-soc tree got a conflict in
> drivers/leds/leds-ns2.c between commit 98ea1ea20cb7 ("leds: remove use of
> __devinit") from the driver-core tree and commit 72052fcc1026 ("leds:
> leds-ns2: add device tree binding") from the arm-soc tree.
> 
> I fixed it up (see below) and can carry the fix as necessary (no action
> is required).

Looks good, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: linux-next: manual merge of the arm-soc tree with the driver-core tree
  2012-11-29  5:03 linux-next: manual merge of the arm-soc tree with the driver-core tree Stephen Rothwell
  2012-11-29  5:17 ` Greg KH
@ 2012-11-29 22:59 ` Simon Guinot
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Guinot @ 2012-11-29 22:59 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Arnd Bergmann, Bill Pemberton, Greg KH, linux-kernel, linux-next,
	Olof Johansson, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 3268 bytes --]

On Thu, Nov 29, 2012 at 04:03:09PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the arm-soc tree got a conflict in
> drivers/leds/leds-ns2.c between commit 98ea1ea20cb7 ("leds: remove use of
> __devinit") from the driver-core tree and commit 72052fcc1026 ("leds:
> leds-ns2: add device tree binding") from the arm-soc tree.
> 
> I fixed it up (see below) and can carry the fix as necessary (no action
> is required).

Hi Stephen,

The merge is fine and the driver works as expected.

Thanks.

Simon

> 
> -- 
> Cheers,
> Stephen Rothwell                    sfr@canb.auug.org.au
> 
> diff --cc drivers/leds/leds-ns2.c
> index bc6a0db,d64cc22..0000000
> --- a/drivers/leds/leds-ns2.c
> +++ b/drivers/leds/leds-ns2.c
> @@@ -247,9 -260,67 +248,65 @@@ static void delete_ns2_led(struct ns2_l
>   {
>   	device_remove_file(led_dat->cdev.dev, &dev_attr_sata);
>   	led_classdev_unregister(&led_dat->cdev);
>  -	gpio_free(led_dat->cmd);
>  -	gpio_free(led_dat->slow);
>   }
>   
> + #ifdef CONFIG_OF_GPIO
> + /*
> +  * Translate OpenFirmware node properties into platform_data.
> +  */
>  -static int __devinit
> ++static int
> + ns2_leds_get_of_pdata(struct device *dev, struct ns2_led_platform_data *pdata)
> + {
> + 	struct device_node *np = dev->of_node;
> + 	struct device_node *child;
> + 	struct ns2_led *leds;
> + 	int num_leds = 0;
> + 	int i = 0;
> + 
> + 	num_leds = of_get_child_count(np);
> + 	if (!num_leds)
> + 		return -ENODEV;
> + 
> + 	leds = devm_kzalloc(dev, num_leds * sizeof(struct ns2_led),
> + 			    GFP_KERNEL);
> + 	if (!leds)
> + 		return -ENOMEM;
> + 
> + 	for_each_child_of_node(np, child) {
> + 		const char *string;
> + 		int ret;
> + 
> + 		ret = of_get_named_gpio(child, "cmd-gpio", 0);
> + 		if (ret < 0)
> + 			return ret;
> + 		leds[i].cmd = ret;
> + 		ret = of_get_named_gpio(child, "slow-gpio", 0);
> + 		if (ret < 0)
> + 			return ret;
> + 		leds[i].slow = ret;
> + 		ret = of_property_read_string(child, "label", &string);
> + 		leds[i].name = (ret == 0) ? string : child->name;
> + 		ret = of_property_read_string(child, "linux,default-trigger",
> + 					      &string);
> + 		if (ret == 0)
> + 			leds[i].default_trigger = string;
> + 
> + 		i++;
> + 	}
> + 
> + 	pdata->leds = leds;
> + 	pdata->num_leds = num_leds;
> + 
> + 	return 0;
> + }
> + 
> + static const struct of_device_id of_ns2_leds_match[] = {
> + 	{ .compatible = "lacie,ns2-leds", },
> + 	{},
> + };
> + #endif /* CONFIG_OF_GPIO */
> + 
>  -static int __devinit ns2_led_probe(struct platform_device *pdev)
>  +static int ns2_led_probe(struct platform_device *pdev)
>   {
>   	struct ns2_led_platform_data *pdata = pdev->dev.platform_data;
>   	struct ns2_led_data *leds_data;
> @@@ -296,10 -381,11 +367,11 @@@ static int ns2_led_remove(struct platfo
>   
>   static struct platform_driver ns2_led_driver = {
>   	.probe		= ns2_led_probe,
>  -	.remove		= __devexit_p(ns2_led_remove),
>  +	.remove		= ns2_led_remove,
>   	.driver		= {
> - 		.name	= "leds-ns2",
> - 		.owner	= THIS_MODULE,
> + 		.name		= "leds-ns2",
> + 		.owner		= THIS_MODULE,
> + 		.of_match_table	= of_match_ptr(of_ns2_leds_match),
>   	},
>   };
>   



[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-29 22:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-29  5:03 linux-next: manual merge of the arm-soc tree with the driver-core tree Stephen Rothwell
2012-11-29  5:17 ` Greg KH
2012-11-29 22:59 ` Simon Guinot

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).