All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Input: twl4030-vibra: remove legacy pdata support
@ 2016-11-22 10:59 Nicolae Rosia
  2016-11-22 11:19 ` Peter Ujfalusi
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolae Rosia @ 2016-11-22 10:59 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Marek Belisko, Baruch Siach, Peter Ujfalusi, linux-input,
	linux-omap, Tony Lindgren, Nicolae Rosia

Remove dead code since all users are device tree enabled.

Signed-off-by: Nicolae Rosia <Nicolae_Rosia@mentor.com>
---
 drivers/input/misc/twl4030-vibra.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/input/misc/twl4030-vibra.c b/drivers/input/misc/twl4030-vibra.c
index caa5a62..5acc241 100644
--- a/drivers/input/misc/twl4030-vibra.c
+++ b/drivers/input/misc/twl4030-vibra.c
@@ -177,12 +177,8 @@ static int __maybe_unused twl4030_vibra_resume(struct device *dev)
 static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops,
 			 twl4030_vibra_suspend, twl4030_vibra_resume);
 
-static bool twl4030_vibra_check_coexist(struct twl4030_vibra_data *pdata,
-			      struct device_node *node)
+static bool twl4030_vibra_check_coexist(struct device_node *node)
 {
-	if (pdata && pdata->coexist)
-		return true;
-
 	node = of_find_node_by_name(node, "codec");
 	if (node) {
 		of_node_put(node);
@@ -194,13 +190,12 @@ static bool twl4030_vibra_check_coexist(struct twl4030_vibra_data *pdata,
 
 static int twl4030_vibra_probe(struct platform_device *pdev)
 {
-	struct twl4030_vibra_data *pdata = dev_get_platdata(&pdev->dev);
 	struct device_node *twl4030_core_node = pdev->dev.parent->of_node;
 	struct vibra_info *info;
 	int ret;
 
-	if (!pdata && !twl4030_core_node) {
-		dev_dbg(&pdev->dev, "platform_data not available\n");
+	if (!twl4030_core_node) {
+		dev_err(&pdev->dev, "no DT info\n\n");
 		return -EINVAL;
 	}
 
@@ -209,7 +204,7 @@ static int twl4030_vibra_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	info->dev = &pdev->dev;
-	info->coexist = twl4030_vibra_check_coexist(pdata, twl4030_core_node);
+	info->coexist = twl4030_vibra_check_coexist(twl4030_core_node);
 	INIT_WORK(&info->play_work, vibra_play_work);
 
 	info->input_dev = devm_input_allocate_device(&pdev->dev);
-- 
2.7.4


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

* Re: [PATCH] Input: twl4030-vibra: remove legacy pdata support
  2016-11-22 10:59 [PATCH] Input: twl4030-vibra: remove legacy pdata support Nicolae Rosia
@ 2016-11-22 11:19 ` Peter Ujfalusi
  2016-11-23  1:33   ` Dmitry Torokhov
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Ujfalusi @ 2016-11-22 11:19 UTC (permalink / raw)
  To: Nicolae Rosia, Dmitry Torokhov
  Cc: Marek Belisko, Baruch Siach, linux-input, linux-omap, Tony Lindgren



On 11/22/2016 12:59 PM, Nicolae Rosia wrote:
> Remove dead code since all users are device tree enabled.

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> Signed-off-by: Nicolae Rosia <Nicolae_Rosia@mentor.com>
> ---
>  drivers/input/misc/twl4030-vibra.c | 13 ++++---------
>  1 file changed, 4 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/input/misc/twl4030-vibra.c b/drivers/input/misc/twl4030-vibra.c
> index caa5a62..5acc241 100644
> --- a/drivers/input/misc/twl4030-vibra.c
> +++ b/drivers/input/misc/twl4030-vibra.c
> @@ -177,12 +177,8 @@ static int __maybe_unused twl4030_vibra_resume(struct device *dev)
>  static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops,
>  			 twl4030_vibra_suspend, twl4030_vibra_resume);
>  
> -static bool twl4030_vibra_check_coexist(struct twl4030_vibra_data *pdata,
> -			      struct device_node *node)
> +static bool twl4030_vibra_check_coexist(struct device_node *node)
>  {
> -	if (pdata && pdata->coexist)
> -		return true;
> -
>  	node = of_find_node_by_name(node, "codec");
>  	if (node) {
>  		of_node_put(node);
> @@ -194,13 +190,12 @@ static bool twl4030_vibra_check_coexist(struct twl4030_vibra_data *pdata,
>  
>  static int twl4030_vibra_probe(struct platform_device *pdev)
>  {
> -	struct twl4030_vibra_data *pdata = dev_get_platdata(&pdev->dev);
>  	struct device_node *twl4030_core_node = pdev->dev.parent->of_node;
>  	struct vibra_info *info;
>  	int ret;
>  
> -	if (!pdata && !twl4030_core_node) {
> -		dev_dbg(&pdev->dev, "platform_data not available\n");
> +	if (!twl4030_core_node) {
> +		dev_err(&pdev->dev, "no DT info\n\n");
>  		return -EINVAL;
>  	}
>  
> @@ -209,7 +204,7 @@ static int twl4030_vibra_probe(struct platform_device *pdev)
>  		return -ENOMEM;
>  
>  	info->dev = &pdev->dev;
> -	info->coexist = twl4030_vibra_check_coexist(pdata, twl4030_core_node);
> +	info->coexist = twl4030_vibra_check_coexist(twl4030_core_node);
>  	INIT_WORK(&info->play_work, vibra_play_work);
>  
>  	info->input_dev = devm_input_allocate_device(&pdev->dev);
> 

-- 
Péter

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

* Re: [PATCH] Input: twl4030-vibra: remove legacy pdata support
  2016-11-22 11:19 ` Peter Ujfalusi
@ 2016-11-23  1:33   ` Dmitry Torokhov
  2016-11-23  9:59     ` Nicolae Rosia
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2016-11-23  1:33 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: Nicolae Rosia, Marek Belisko, Baruch Siach, linux-input,
	linux-omap, Tony Lindgren

On Tue, Nov 22, 2016 at 01:19:36PM +0200, Peter Ujfalusi wrote:
> 
> 
> On 11/22/2016 12:59 PM, Nicolae Rosia wrote:
> > Remove dead code since all users are device tree enabled.
> 
> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> 
> > Signed-off-by: Nicolae Rosia <Nicolae_Rosia@mentor.com>
> > ---
> >  drivers/input/misc/twl4030-vibra.c | 13 ++++---------
> >  1 file changed, 4 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/input/misc/twl4030-vibra.c b/drivers/input/misc/twl4030-vibra.c
> > index caa5a62..5acc241 100644
> > --- a/drivers/input/misc/twl4030-vibra.c
> > +++ b/drivers/input/misc/twl4030-vibra.c
> > @@ -177,12 +177,8 @@ static int __maybe_unused twl4030_vibra_resume(struct device *dev)
> >  static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops,
> >  			 twl4030_vibra_suspend, twl4030_vibra_resume);
> >  
> > -static bool twl4030_vibra_check_coexist(struct twl4030_vibra_data *pdata,
> > -			      struct device_node *node)
> > +static bool twl4030_vibra_check_coexist(struct device_node *node)
> >  {
> > -	if (pdata && pdata->coexist)
> > -		return true;
> > -
> >  	node = of_find_node_by_name(node, "codec");
> >  	if (node) {
> >  		of_node_put(node);

Do we need this wrapper anymore?

> > @@ -194,13 +190,12 @@ static bool twl4030_vibra_check_coexist(struct twl4030_vibra_data *pdata,
> >  
> >  static int twl4030_vibra_probe(struct platform_device *pdev)
> >  {
> > -	struct twl4030_vibra_data *pdata = dev_get_platdata(&pdev->dev);

Should we also remove twl4030_vibra_data definition?

> >  	struct device_node *twl4030_core_node = pdev->dev.parent->of_node;
> >  	struct vibra_info *info;
> >  	int ret;
> >  
> > -	if (!pdata && !twl4030_core_node) {
> > -		dev_dbg(&pdev->dev, "platform_data not available\n");
> > +	if (!twl4030_core_node) {
> > +		dev_err(&pdev->dev, "no DT info\n\n");

Why double newline?

> >  		return -EINVAL;
> >  	}
> >  
> > @@ -209,7 +204,7 @@ static int twl4030_vibra_probe(struct platform_device *pdev)
> >  		return -ENOMEM;
> >  
> >  	info->dev = &pdev->dev;
> > -	info->coexist = twl4030_vibra_check_coexist(pdata, twl4030_core_node);
> > +	info->coexist = twl4030_vibra_check_coexist(twl4030_core_node);
> >  	INIT_WORK(&info->play_work, vibra_play_work);
> >  
> >  	info->input_dev = devm_input_allocate_device(&pdev->dev);
> >

Thanks.

-- 
Dmitry

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

* Re: [PATCH] Input: twl4030-vibra: remove legacy pdata support
  2016-11-23  1:33   ` Dmitry Torokhov
@ 2016-11-23  9:59     ` Nicolae Rosia
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolae Rosia @ 2016-11-23  9:59 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Peter Ujfalusi, Nicolae Rosia, Marek Belisko, Baruch Siach,
	linux-input, linux-omap, Tony Lindgren

Hi Dmitry,

On Wed, Nov 23, 2016 at 3:33 AM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>> > -static bool twl4030_vibra_check_coexist(struct twl4030_vibra_data *pdata,
>> > -                         struct device_node *node)
>> > +static bool twl4030_vibra_check_coexist(struct device_node *node)
>> >  {
>> > -   if (pdata && pdata->coexist)
>> > -           return true;
>> > -
>> >     node = of_find_node_by_name(node, "codec");
>> >     if (node) {
>> >             of_node_put(node);
>
> Do we need this wrapper anymore?
>
I kept the original logic.
It seems that when there's also a "codec" DT entry, the logic is different.

>> > @@ -194,13 +190,12 @@ static bool twl4030_vibra_check_coexist(struct twl4030_vibra_data *pdata,
>> >
>> >  static int twl4030_vibra_probe(struct platform_device *pdev)
>> >  {
>> > -   struct twl4030_vibra_data *pdata = dev_get_platdata(&pdev->dev);
>
> Should we also remove twl4030_vibra_data definition?
>
Yes, but that is defined in include/linux/i2c/twl.h. Since I've sent
multiple cleanup patches regarding twl, I thought it would be wise to
wait until the next cycle to remove them all to avoid merge conflicts.
I don't know how I should go with this, since I could:
a) make another commit removing the pdata definition
b) include the pdata definition removal in this commit
c) wait until the next cycle

>> >     struct device_node *twl4030_core_node = pdev->dev.parent->of_node;
>> >     struct vibra_info *info;
>> >     int ret;
>> >
>> > -   if (!pdata && !twl4030_core_node) {
>> > -           dev_dbg(&pdev->dev, "platform_data not available\n");
>> > +   if (!twl4030_core_node) {
>> > +           dev_err(&pdev->dev, "no DT info\n\n");
>
> Why double newline?
This is a typo. Should I send v2 or you can modify it while applying?

Thanks,
Nicolae

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

end of thread, other threads:[~2016-11-23  9:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-22 10:59 [PATCH] Input: twl4030-vibra: remove legacy pdata support Nicolae Rosia
2016-11-22 11:19 ` Peter Ujfalusi
2016-11-23  1:33   ` Dmitry Torokhov
2016-11-23  9:59     ` Nicolae Rosia

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.