Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1742351 > unrolled thread

[PATCH 00/12] use managed devm_device_add_group for all touchscreen drivers

Started byAndi Shyti <andi@etezian.org>
First post2017-09-29 23:00 +0200
Last post2017-09-30 01:40 +0200
Articles 15 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 00/12] use managed devm_device_add_group for all touchscreen drivers Andi Shyti <andi@etezian.org> - 2017-09-29 23:00 +0200
    [PATCH 08/12] Input: melfas_mip4 - use managed devm_device_add_group Andi Shyti <andi@etezian.org> - 2017-09-29 23:20 +0200
      Re: [PATCH 08/12] Input: melfas_mip4 - use managed  devm_device_add_group Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-09-30 01:40 +0200
    [PATCH 02/12] Input: ad7879 - use managed devm_device_add_group Andi Shyti <andi@etezian.org> - 2017-09-29 23:20 +0200
      Re: [PATCH 02/12] Input: ad7879 - use managed devm_device_add_group Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-09-30 01:50 +0200
    [PATCH 04/12] Input: atmel_mxt_ts - use managed devm_device_add_group Andi Shyti <andi@etezian.org> - 2017-09-29 23:20 +0200
      Re: [PATCH 04/12] Input: atmel_mxt_ts - use managed  devm_device_add_group Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-09-30 01:50 +0200
    [PATCH 12/12] Input: wdt87xx_i2c - use managed devm_device_add_group Andi Shyti <andi@etezian.org> - 2017-09-29 23:20 +0200
      Re: [PATCH 12/12] Input: wdt87xx_i2c - use managed  devm_device_add_group Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-09-30 01:50 +0200
    [PATCH 05/12] Input: edt-ft5x06 - use managed devm_device_add_group Andi Shyti <andi@etezian.org> - 2017-09-30 00:00 +0200
      Re: [PATCH 05/12] Input: edt-ft5x06 - use managed  devm_device_add_group Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-09-30 01:50 +0200
    [PATCH 06/12] Input: elants_i2c - use managed devm_device_add_group Andi Shyti <andi@etezian.org> - 2017-09-30 00:00 +0200
      Re: [PATCH 06/12] Input: elants_i2c - use managed  devm_device_add_group Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-09-30 01:40 +0200
    [PATCH 09/12] Input: raydium_i2c_ts -  use managed devm_device_add_group Andi Shyti <andi@etezian.org> - 2017-09-30 00:00 +0200
      Re: [PATCH 09/12] Input: raydium_i2c_ts -  use managed  devm_device_add_group Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-09-30 01:40 +0200

#1742351 — [PATCH 00/12] use managed devm_device_add_group for all touchscreen drivers

FromAndi Shyti <andi@etezian.org>
Date2017-09-29 23:00 +0200
Subject[PATCH 00/12] use managed devm_device_add_group for all touchscreen drivers
Message-ID<uvay6-2Kr-17@gated-at.bofh.it>
Hi,

this patch series uses Dmitry's patch

  57b8ff070f98 driver core: add devm_device_add_group() and friends

each of the 12 patches replaces the sysfs_create_group() function
with its managed version devm_device_add_group.

Andi

Andi Shyti (12):
  Input: ad7897 - use managed devm_device_add_group
  Input: ad7879 - use managed devm_device_add_group
  Input: ads7846 - use managed devm_device_add_group
  Input: atmel_mxt_ts - use managed devm_device_add_group
  Input: edt-ft5x06 - use managed devm_device_add_group
  Input: elants_i2c - use managed devm_device_add_group
  Input: ili210x - use managed devm_device_add_group
  Input: melfas_mip4 - use managed devm_device_add_group
  Input: raydium_i2c_ts -  use managed devm_device_add_group
  Input: rohm_bu21023 - use managed devm_device_add_group
  Input: tsc200x-core - use managed devm_device_add_group
  Input: wdt87xx_i2c - use managed devm_device_add_group

 drivers/input/touchscreen/ad7877.c         |  8 ++------
 drivers/input/touchscreen/ad7879.c         | 13 +------------
 drivers/input/touchscreen/ads7846.c        |  8 ++------
 drivers/input/touchscreen/atmel_mxt_ts.c   |  3 +--
 drivers/input/touchscreen/edt-ft5x06.c     |  9 ++-------
 drivers/input/touchscreen/elants_i2c.c     | 19 +------------------
 drivers/input/touchscreen/ili210x.c        |  7 ++-----
 drivers/input/touchscreen/melfas_mip4.c    | 17 +----------------
 drivers/input/touchscreen/raydium_i2c_ts.c | 18 +-----------------
 drivers/input/touchscreen/rohm_bu21023.c   | 17 +----------------
 drivers/input/touchscreen/tsc200x-core.c   |  8 ++------
 drivers/input/touchscreen/wdt87xx_i2c.c    |  4 +---
 12 files changed, 17 insertions(+), 114 deletions(-)

-- 
2.14.2

[toc] | [next] | [standalone]


#1742353 — [PATCH 08/12] Input: melfas_mip4 - use managed devm_device_add_group

FromAndi Shyti <andi@etezian.org>
Date2017-09-29 23:20 +0200
Subject[PATCH 08/12] Input: melfas_mip4 - use managed devm_device_add_group
Message-ID<uvaRr-36U-7@gated-at.bofh.it>
In reply to#1742351
Commit 57b8ff070f98 ("driver core: add devm_device_add_group()
and friends") has added the the managed version for creating
sysfs group files.

Use devm_device_add_group instead of sysfs_create_group and
remove the action that cleans the sysfs file when exiting the
driver.

CC: Sangwon Jee <jeesw@melfas.com>
Signed-off-by: Andi Shyti <andi@etezian.org>
---
 drivers/input/touchscreen/melfas_mip4.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/drivers/input/touchscreen/melfas_mip4.c b/drivers/input/touchscreen/melfas_mip4.c
index 05108c2fea93..6892f0e28918 100644
--- a/drivers/input/touchscreen/melfas_mip4.c
+++ b/drivers/input/touchscreen/melfas_mip4.c
@@ -1433,13 +1433,6 @@ static const struct attribute_group mip4_attr_group = {
 	.attrs = mip4_attrs,
 };
 
-static void mip4_sysfs_remove(void *_data)
-{
-	struct mip4_ts *ts = _data;
-
-	sysfs_remove_group(&ts->client->dev.kobj, &mip4_attr_group);
-}
-
 static int mip4_probe(struct i2c_client *client, const struct i2c_device_id *id)
 {
 	struct mip4_ts *ts;
@@ -1535,21 +1528,13 @@ static int mip4_probe(struct i2c_client *client, const struct i2c_device_id *id)
 		return error;
 	}
 
-	error = sysfs_create_group(&client->dev.kobj, &mip4_attr_group);
+	error = devm_device_add_group(&client->dev, &mip4_attr_group);
 	if (error) {
 		dev_err(&client->dev,
 			"Failed to create sysfs attribute group: %d\n", error);
 		return error;
 	}
 
-	error = devm_add_action(&client->dev, mip4_sysfs_remove, ts);
-	if (error) {
-		mip4_sysfs_remove(ts);
-		dev_err(&client->dev,
-			"Failed to install sysfs remoce action: %d\n", error);
-		return error;
-	}
-
 	return 0;
 }
 
-- 
2.14.2

[toc] | [prev] | [next] | [standalone]


#1742399 — Re: [PATCH 08/12] Input: melfas_mip4 - use managed devm_device_add_group

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2017-09-30 01:40 +0200
SubjectRe: [PATCH 08/12] Input: melfas_mip4 - use managed devm_device_add_group
Message-ID<uvd2V-4rw-5@gated-at.bofh.it>
In reply to#1742353
On Sat, Sep 30, 2017 at 05:38:35AM +0900, Andi Shyti wrote:
> Commit 57b8ff070f98 ("driver core: add devm_device_add_group()
> and friends") has added the the managed version for creating
> sysfs group files.
> 
> Use devm_device_add_group instead of sysfs_create_group and
> remove the action that cleans the sysfs file when exiting the
> driver.
> 
> CC: Sangwon Jee <jeesw@melfas.com>
> Signed-off-by: Andi Shyti <andi@etezian.org>

Applied, thank you.

> ---
>  drivers/input/touchscreen/melfas_mip4.c | 17 +----------------
>  1 file changed, 1 insertion(+), 16 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/melfas_mip4.c b/drivers/input/touchscreen/melfas_mip4.c
> index 05108c2fea93..6892f0e28918 100644
> --- a/drivers/input/touchscreen/melfas_mip4.c
> +++ b/drivers/input/touchscreen/melfas_mip4.c
> @@ -1433,13 +1433,6 @@ static const struct attribute_group mip4_attr_group = {
>  	.attrs = mip4_attrs,
>  };
>  
> -static void mip4_sysfs_remove(void *_data)
> -{
> -	struct mip4_ts *ts = _data;
> -
> -	sysfs_remove_group(&ts->client->dev.kobj, &mip4_attr_group);
> -}
> -
>  static int mip4_probe(struct i2c_client *client, const struct i2c_device_id *id)
>  {
>  	struct mip4_ts *ts;
> @@ -1535,21 +1528,13 @@ static int mip4_probe(struct i2c_client *client, const struct i2c_device_id *id)
>  		return error;
>  	}
>  
> -	error = sysfs_create_group(&client->dev.kobj, &mip4_attr_group);
> +	error = devm_device_add_group(&client->dev, &mip4_attr_group);
>  	if (error) {
>  		dev_err(&client->dev,
>  			"Failed to create sysfs attribute group: %d\n", error);
>  		return error;
>  	}
>  
> -	error = devm_add_action(&client->dev, mip4_sysfs_remove, ts);
> -	if (error) {
> -		mip4_sysfs_remove(ts);
> -		dev_err(&client->dev,
> -			"Failed to install sysfs remoce action: %d\n", error);
> -		return error;
> -	}
> -
>  	return 0;
>  }
>  
> -- 
> 2.14.2
> 

-- 
Dmitry

[toc] | [prev] | [next] | [standalone]


#1742354 — [PATCH 02/12] Input: ad7879 - use managed devm_device_add_group

FromAndi Shyti <andi@etezian.org>
Date2017-09-29 23:20 +0200
Subject[PATCH 02/12] Input: ad7879 - use managed devm_device_add_group
Message-ID<uvaRr-36U-11@gated-at.bofh.it>
In reply to#1742351
Commit 57b8ff070f98 ("driver core: add devm_device_add_group()
and friends") has added the the managed version for creating
sysfs group files.

Use devm_device_add_group instead of sysfs_create_group and
remove the action that cleans the sysfs file when exiting the
driver.

CC: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Andi Shyti <andi@etezian.org>
---
 drivers/input/touchscreen/ad7879.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c
index 196028c45210..7d74a0ae2c94 100644
--- a/drivers/input/touchscreen/ad7879.c
+++ b/drivers/input/touchscreen/ad7879.c
@@ -524,13 +524,6 @@ static int ad7879_parse_dt(struct device *dev, struct ad7879 *ts)
 	return 0;
 }
 
-static void ad7879_cleanup_sysfs(void *_ts)
-{
-	struct ad7879 *ts = _ts;
-
-	sysfs_remove_group(&ts->dev->kobj, &ad7879_attr_group);
-}
-
 int ad7879_probe(struct device *dev, struct regmap *regmap,
 		 int irq, u16 bustype, u8 devid)
 {
@@ -658,11 +651,7 @@ int ad7879_probe(struct device *dev, struct regmap *regmap,
 
 	__ad7879_disable(ts);
 
-	err = sysfs_create_group(&dev->kobj, &ad7879_attr_group);
-	if (err)
-		return err;
-
-	err = devm_add_action_or_reset(dev, ad7879_cleanup_sysfs, ts);
+	err = devm_device_add_group(dev, &ad7879_attr_group);
 	if (err)
 		return err;
 
-- 
2.14.2

[toc] | [prev] | [next] | [standalone]


#1742402 — Re: [PATCH 02/12] Input: ad7879 - use managed devm_device_add_group

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2017-09-30 01:50 +0200
SubjectRe: [PATCH 02/12] Input: ad7879 - use managed devm_device_add_group
Message-ID<uvdcB-4vC-1@gated-at.bofh.it>
In reply to#1742354
On Sat, Sep 30, 2017 at 05:38:29AM +0900, Andi Shyti wrote:
> Commit 57b8ff070f98 ("driver core: add devm_device_add_group()
> and friends") has added the the managed version for creating
> sysfs group files.
> 
> Use devm_device_add_group instead of sysfs_create_group and
> remove the action that cleans the sysfs file when exiting the
> driver.
> 
> CC: Michael Hennerich <michael.hennerich@analog.com>
> Signed-off-by: Andi Shyti <andi@etezian.org>

Applied, thank you.

> ---
>  drivers/input/touchscreen/ad7879.c | 13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c
> index 196028c45210..7d74a0ae2c94 100644
> --- a/drivers/input/touchscreen/ad7879.c
> +++ b/drivers/input/touchscreen/ad7879.c
> @@ -524,13 +524,6 @@ static int ad7879_parse_dt(struct device *dev, struct ad7879 *ts)
>  	return 0;
>  }
>  
> -static void ad7879_cleanup_sysfs(void *_ts)
> -{
> -	struct ad7879 *ts = _ts;
> -
> -	sysfs_remove_group(&ts->dev->kobj, &ad7879_attr_group);
> -}
> -
>  int ad7879_probe(struct device *dev, struct regmap *regmap,
>  		 int irq, u16 bustype, u8 devid)
>  {
> @@ -658,11 +651,7 @@ int ad7879_probe(struct device *dev, struct regmap *regmap,
>  
>  	__ad7879_disable(ts);
>  
> -	err = sysfs_create_group(&dev->kobj, &ad7879_attr_group);
> -	if (err)
> -		return err;
> -
> -	err = devm_add_action_or_reset(dev, ad7879_cleanup_sysfs, ts);
> +	err = devm_device_add_group(dev, &ad7879_attr_group);
>  	if (err)
>  		return err;
>  
> -- 
> 2.14.2
> 

-- 
Dmitry

[toc] | [prev] | [next] | [standalone]


#1742357 — [PATCH 04/12] Input: atmel_mxt_ts - use managed devm_device_add_group

FromAndi Shyti <andi@etezian.org>
Date2017-09-29 23:20 +0200
Subject[PATCH 04/12] Input: atmel_mxt_ts - use managed devm_device_add_group
Message-ID<uvaRs-36U-21@gated-at.bofh.it>
In reply to#1742351
Commit 57b8ff070f98 ("driver core: add devm_device_add_group()
and friends") has added the the managed version for creating
sysfs group files.

Use devm_device_add_group instead of sysfs_create_group.

CC: Nick Dyer <nick@shmanahar.org>
Signed-off-by: Andi Shyti <andi@etezian.org>
---
 drivers/input/touchscreen/atmel_mxt_ts.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 7659bc48f1db..e5968f136f08 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -3170,7 +3170,7 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id)
 	if (error)
 		return error;
 
-	error = sysfs_create_group(&client->dev.kobj, &mxt_attr_group);
+	error = devm_device_add_group(&client->dev, &mxt_attr_group);
 	if (error) {
 		dev_err(&client->dev, "Failure %d creating sysfs group\n",
 			error);
@@ -3190,7 +3190,6 @@ static int mxt_remove(struct i2c_client *client)
 	struct mxt_data *data = i2c_get_clientdata(client);
 
 	disable_irq(data->irq);
-	sysfs_remove_group(&client->dev.kobj, &mxt_attr_group);
 	mxt_free_input_device(data);
 	mxt_free_object_table(data);
 
-- 
2.14.2

[toc] | [prev] | [next] | [standalone]


#1742411 — Re: [PATCH 04/12] Input: atmel_mxt_ts - use managed devm_device_add_group

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2017-09-30 01:50 +0200
SubjectRe: [PATCH 04/12] Input: atmel_mxt_ts - use managed devm_device_add_group
Message-ID<uvdcD-4vC-19@gated-at.bofh.it>
In reply to#1742357
On Sat, Sep 30, 2017 at 05:38:31AM +0900, Andi Shyti wrote:
> Commit 57b8ff070f98 ("driver core: add devm_device_add_group()
> and friends") has added the the managed version for creating
> sysfs group files.
> 
> Use devm_device_add_group instead of sysfs_create_group.
> 
> CC: Nick Dyer <nick@shmanahar.org>
> Signed-off-by: Andi Shyti <andi@etezian.org>
> ---
>  drivers/input/touchscreen/atmel_mxt_ts.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
> index 7659bc48f1db..e5968f136f08 100644
> --- a/drivers/input/touchscreen/atmel_mxt_ts.c
> +++ b/drivers/input/touchscreen/atmel_mxt_ts.c
> @@ -3170,7 +3170,7 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id)
>  	if (error)
>  		return error;
>  
> -	error = sysfs_create_group(&client->dev.kobj, &mxt_attr_group);
> +	error = devm_device_add_group(&client->dev, &mxt_attr_group);
>  	if (error) {
>  		dev_err(&client->dev, "Failure %d creating sysfs group\n",
>  			error);
> @@ -3190,7 +3190,6 @@ static int mxt_remove(struct i2c_client *client)
>  	struct mxt_data *data = i2c_get_clientdata(client);
>  
>  	disable_irq(data->irq);
> -	sysfs_remove_group(&client->dev.kobj, &mxt_attr_group);

Wrong ordering.

>  	mxt_free_input_device(data);
>  	mxt_free_object_table(data);
>  
> -- 
> 2.14.2
> 

-- 
Dmitry

[toc] | [prev] | [next] | [standalone]


#1742358 — [PATCH 12/12] Input: wdt87xx_i2c - use managed devm_device_add_group

FromAndi Shyti <andi@etezian.org>
Date2017-09-29 23:20 +0200
Subject[PATCH 12/12] Input: wdt87xx_i2c - use managed devm_device_add_group
Message-ID<uvaRr-36U-17@gated-at.bofh.it>
In reply to#1742351
Commit 57b8ff070f98 ("driver core: add devm_device_add_group()
and friends") has added the the managed version for creating
sysfs group files.

Use devm_device_add_group instead of sysfs_create_group and
remove the relative sysfs_remove_group.

Signed-off-by: Andi Shyti <andi@etezian.org>
---
 drivers/input/touchscreen/wdt87xx_i2c.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/input/touchscreen/wdt87xx_i2c.c b/drivers/input/touchscreen/wdt87xx_i2c.c
index a9132603ab34..b866cc88d942 100644
--- a/drivers/input/touchscreen/wdt87xx_i2c.c
+++ b/drivers/input/touchscreen/wdt87xx_i2c.c
@@ -1106,7 +1106,7 @@ static int wdt87xx_ts_probe(struct i2c_client *client,
 		return error;
 	}
 
-	error = sysfs_create_group(&client->dev.kobj, &wdt87xx_attr_group);
+	error = devm_device_add_group(&client->dev, &wdt87xx_attr_group);
 	if (error) {
 		dev_err(&client->dev, "create sysfs failed: %d\n", error);
 		return error;
@@ -1117,8 +1117,6 @@ static int wdt87xx_ts_probe(struct i2c_client *client,
 
 static int wdt87xx_ts_remove(struct i2c_client *client)
 {
-	sysfs_remove_group(&client->dev.kobj, &wdt87xx_attr_group);
-
 	return 0;
 }
 
-- 
2.14.2

[toc] | [prev] | [next] | [standalone]


#1742410 — Re: [PATCH 12/12] Input: wdt87xx_i2c - use managed devm_device_add_group

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2017-09-30 01:50 +0200
SubjectRe: [PATCH 12/12] Input: wdt87xx_i2c - use managed devm_device_add_group
Message-ID<uvdcD-4vC-15@gated-at.bofh.it>
In reply to#1742358
On Sat, Sep 30, 2017 at 05:38:39AM +0900, Andi Shyti wrote:
> Commit 57b8ff070f98 ("driver core: add devm_device_add_group()
> and friends") has added the the managed version for creating
> sysfs group files.
> 
> Use devm_device_add_group instead of sysfs_create_group and
> remove the relative sysfs_remove_group.
> 
> Signed-off-by: Andi Shyti <andi@etezian.org>

Applied, thank you.

> ---
>  drivers/input/touchscreen/wdt87xx_i2c.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/wdt87xx_i2c.c b/drivers/input/touchscreen/wdt87xx_i2c.c
> index a9132603ab34..b866cc88d942 100644
> --- a/drivers/input/touchscreen/wdt87xx_i2c.c
> +++ b/drivers/input/touchscreen/wdt87xx_i2c.c
> @@ -1106,7 +1106,7 @@ static int wdt87xx_ts_probe(struct i2c_client *client,
>  		return error;
>  	}
>  
> -	error = sysfs_create_group(&client->dev.kobj, &wdt87xx_attr_group);
> +	error = devm_device_add_group(&client->dev, &wdt87xx_attr_group);
>  	if (error) {
>  		dev_err(&client->dev, "create sysfs failed: %d\n", error);
>  		return error;
> @@ -1117,8 +1117,6 @@ static int wdt87xx_ts_probe(struct i2c_client *client,
>  
>  static int wdt87xx_ts_remove(struct i2c_client *client)
>  {
> -	sysfs_remove_group(&client->dev.kobj, &wdt87xx_attr_group);
> -
>  	return 0;
>  }
>  
> -- 
> 2.14.2
> 

-- 
Dmitry

[toc] | [prev] | [next] | [standalone]


#1742374 — [PATCH 05/12] Input: edt-ft5x06 - use managed devm_device_add_group

FromAndi Shyti <andi@etezian.org>
Date2017-09-30 00:00 +0200
Subject[PATCH 05/12] Input: edt-ft5x06 - use managed devm_device_add_group
Message-ID<uvbu9-3kX-3@gated-at.bofh.it>
In reply to#1742351
Commit 57b8ff070f98 ("driver core: add devm_device_add_group()
and friends") has added the the managed version for creating
sysfs group files.

Use devm_device_add_group instead of sysfs_create_group and
remove the relative sysfs_remove_group and goto label.

Signed-off-by: Andi Shyti <andi@etezian.org>
---
 drivers/input/touchscreen/edt-ft5x06.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index 5bf63f76ddda..f879d14f7ffc 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -998,13 +998,13 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
 		return error;
 	}
 
-	error = sysfs_create_group(&client->dev.kobj, &edt_ft5x06_attr_group);
+	error = devm_device_add_group(&client->dev, &edt_ft5x06_attr_group);
 	if (error)
 		return error;
 
 	error = input_register_device(input);
 	if (error)
-		goto err_remove_attrs;
+		return error;
 
 	edt_ft5x06_ts_prepare_debugfs(tsdata, dev_driver_string(&client->dev));
 	device_init_wakeup(&client->dev, 1);
@@ -1016,10 +1016,6 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
 		tsdata->reset_gpio ? desc_to_gpio(tsdata->reset_gpio) : -1);
 
 	return 0;
-
-err_remove_attrs:
-	sysfs_remove_group(&client->dev.kobj, &edt_ft5x06_attr_group);
-	return error;
 }
 
 static int edt_ft5x06_ts_remove(struct i2c_client *client)
@@ -1027,7 +1023,6 @@ static int edt_ft5x06_ts_remove(struct i2c_client *client)
 	struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client);
 
 	edt_ft5x06_ts_teardown_debugfs(tsdata);
-	sysfs_remove_group(&client->dev.kobj, &edt_ft5x06_attr_group);
 
 	return 0;
 }
-- 
2.14.2

[toc] | [prev] | [next] | [standalone]


#1742403 — Re: [PATCH 05/12] Input: edt-ft5x06 - use managed devm_device_add_group

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2017-09-30 01:50 +0200
SubjectRe: [PATCH 05/12] Input: edt-ft5x06 - use managed devm_device_add_group
Message-ID<uvdcC-4vC-3@gated-at.bofh.it>
In reply to#1742374
On Sat, Sep 30, 2017 at 05:38:32AM +0900, Andi Shyti wrote:
> Commit 57b8ff070f98 ("driver core: add devm_device_add_group()
> and friends") has added the the managed version for creating
> sysfs group files.
> 
> Use devm_device_add_group instead of sysfs_create_group and
> remove the relative sysfs_remove_group and goto label.
> 
> Signed-off-by: Andi Shyti <andi@etezian.org>

Applied, thank you.

> ---
>  drivers/input/touchscreen/edt-ft5x06.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
> index 5bf63f76ddda..f879d14f7ffc 100644
> --- a/drivers/input/touchscreen/edt-ft5x06.c
> +++ b/drivers/input/touchscreen/edt-ft5x06.c
> @@ -998,13 +998,13 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
>  		return error;
>  	}
>  
> -	error = sysfs_create_group(&client->dev.kobj, &edt_ft5x06_attr_group);
> +	error = devm_device_add_group(&client->dev, &edt_ft5x06_attr_group);
>  	if (error)
>  		return error;
>  
>  	error = input_register_device(input);
>  	if (error)
> -		goto err_remove_attrs;
> +		return error;
>  
>  	edt_ft5x06_ts_prepare_debugfs(tsdata, dev_driver_string(&client->dev));
>  	device_init_wakeup(&client->dev, 1);
> @@ -1016,10 +1016,6 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
>  		tsdata->reset_gpio ? desc_to_gpio(tsdata->reset_gpio) : -1);
>  
>  	return 0;
> -
> -err_remove_attrs:
> -	sysfs_remove_group(&client->dev.kobj, &edt_ft5x06_attr_group);
> -	return error;
>  }
>  
>  static int edt_ft5x06_ts_remove(struct i2c_client *client)
> @@ -1027,7 +1023,6 @@ static int edt_ft5x06_ts_remove(struct i2c_client *client)
>  	struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client);
>  
>  	edt_ft5x06_ts_teardown_debugfs(tsdata);
> -	sysfs_remove_group(&client->dev.kobj, &edt_ft5x06_attr_group);
>  
>  	return 0;
>  }
> -- 
> 2.14.2
> 

-- 
Dmitry

[toc] | [prev] | [next] | [standalone]


#1742376 — [PATCH 06/12] Input: elants_i2c - use managed devm_device_add_group

FromAndi Shyti <andi@etezian.org>
Date2017-09-30 00:00 +0200
Subject[PATCH 06/12] Input: elants_i2c - use managed devm_device_add_group
Message-ID<uvbu9-3kX-7@gated-at.bofh.it>
In reply to#1742351
Commit 57b8ff070f98 ("driver core: add devm_device_add_group()
and friends") has added the the managed version for creating
sysfs group files.

Use devm_device_add_group instead of sysfs_create_group and
remove the action that cleans the sysfs file when exiting the
driver.

Signed-off-by: Andi Shyti <andi@etezian.org>
---
 drivers/input/touchscreen/elants_i2c.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c
index 0f4cda7282a2..e102d7764bc2 100644
--- a/drivers/input/touchscreen/elants_i2c.c
+++ b/drivers/input/touchscreen/elants_i2c.c
@@ -1070,13 +1070,6 @@ static const struct attribute_group elants_attribute_group = {
 	.attrs = elants_attributes,
 };
 
-static void elants_i2c_remove_sysfs_group(void *_data)
-{
-	struct elants_data *ts = _data;
-
-	sysfs_remove_group(&ts->client->dev.kobj, &elants_attribute_group);
-}
-
 static int elants_i2c_power_on(struct elants_data *ts)
 {
 	int error;
@@ -1289,23 +1282,13 @@ static int elants_i2c_probe(struct i2c_client *client,
 	if (!client->dev.of_node)
 		device_init_wakeup(&client->dev, true);
 
-	error = sysfs_create_group(&client->dev.kobj, &elants_attribute_group);
+	error = devm_device_add_group(&client->dev, &elants_attribute_group);
 	if (error) {
 		dev_err(&client->dev, "failed to create sysfs attributes: %d\n",
 			error);
 		return error;
 	}
 
-	error = devm_add_action(&client->dev,
-				elants_i2c_remove_sysfs_group, ts);
-	if (error) {
-		elants_i2c_remove_sysfs_group(ts);
-		dev_err(&client->dev,
-			"Failed to add sysfs cleanup action: %d\n",
-			error);
-		return error;
-	}
-
 	return 0;
 }
 
-- 
2.14.2

[toc] | [prev] | [next] | [standalone]


#1742401 — Re: [PATCH 06/12] Input: elants_i2c - use managed devm_device_add_group

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2017-09-30 01:40 +0200
SubjectRe: [PATCH 06/12] Input: elants_i2c - use managed devm_device_add_group
Message-ID<uvd2W-4rw-15@gated-at.bofh.it>
In reply to#1742376
On Sat, Sep 30, 2017 at 05:38:33AM +0900, Andi Shyti wrote:
> Commit 57b8ff070f98 ("driver core: add devm_device_add_group()
> and friends") has added the the managed version for creating
> sysfs group files.
> 
> Use devm_device_add_group instead of sysfs_create_group and
> remove the action that cleans the sysfs file when exiting the
> driver.
> 
> Signed-off-by: Andi Shyti <andi@etezian.org>

Applied, thank you.

> ---
>  drivers/input/touchscreen/elants_i2c.c | 19 +------------------
>  1 file changed, 1 insertion(+), 18 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c
> index 0f4cda7282a2..e102d7764bc2 100644
> --- a/drivers/input/touchscreen/elants_i2c.c
> +++ b/drivers/input/touchscreen/elants_i2c.c
> @@ -1070,13 +1070,6 @@ static const struct attribute_group elants_attribute_group = {
>  	.attrs = elants_attributes,
>  };
>  
> -static void elants_i2c_remove_sysfs_group(void *_data)
> -{
> -	struct elants_data *ts = _data;
> -
> -	sysfs_remove_group(&ts->client->dev.kobj, &elants_attribute_group);
> -}
> -
>  static int elants_i2c_power_on(struct elants_data *ts)
>  {
>  	int error;
> @@ -1289,23 +1282,13 @@ static int elants_i2c_probe(struct i2c_client *client,
>  	if (!client->dev.of_node)
>  		device_init_wakeup(&client->dev, true);
>  
> -	error = sysfs_create_group(&client->dev.kobj, &elants_attribute_group);
> +	error = devm_device_add_group(&client->dev, &elants_attribute_group);
>  	if (error) {
>  		dev_err(&client->dev, "failed to create sysfs attributes: %d\n",
>  			error);
>  		return error;
>  	}
>  
> -	error = devm_add_action(&client->dev,
> -				elants_i2c_remove_sysfs_group, ts);
> -	if (error) {
> -		elants_i2c_remove_sysfs_group(ts);
> -		dev_err(&client->dev,
> -			"Failed to add sysfs cleanup action: %d\n",
> -			error);
> -		return error;
> -	}
> -
>  	return 0;
>  }
>  
> -- 
> 2.14.2
> 

-- 
Dmitry

[toc] | [prev] | [next] | [standalone]


#1742377 — [PATCH 09/12] Input: raydium_i2c_ts - use managed devm_device_add_group

FromAndi Shyti <andi@etezian.org>
Date2017-09-30 00:00 +0200
Subject[PATCH 09/12] Input: raydium_i2c_ts - use managed devm_device_add_group
Message-ID<uvbu9-3kX-9@gated-at.bofh.it>
In reply to#1742351
Commit 57b8ff070f98 ("driver core: add devm_device_add_group()
and friends") has added the the managed version for creating
sysfs group files.

Use devm_device_add_group instead of sysfs_create_group and
remove the action that cleans the sysfs file when exiting the
driver.

Signed-off-by: Andi Shyti <andi@etezian.org>
---
 drivers/input/touchscreen/raydium_i2c_ts.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c b/drivers/input/touchscreen/raydium_i2c_ts.c
index 4f1d3fd5d412..100538d64fff 100644
--- a/drivers/input/touchscreen/raydium_i2c_ts.c
+++ b/drivers/input/touchscreen/raydium_i2c_ts.c
@@ -943,13 +943,6 @@ static const struct attribute_group raydium_i2c_attribute_group = {
 	.attrs = raydium_i2c_attributes,
 };
 
-static void raydium_i2c_remove_sysfs_group(void *_data)
-{
-	struct raydium_data *ts = _data;
-
-	sysfs_remove_group(&ts->client->dev.kobj, &raydium_i2c_attribute_group);
-}
-
 static int raydium_i2c_power_on(struct raydium_data *ts)
 {
 	int error;
@@ -1120,7 +1113,7 @@ static int raydium_i2c_probe(struct i2c_client *client,
 		return error;
 	}
 
-	error = sysfs_create_group(&client->dev.kobj,
+	error = devm_device_add_group(&client->dev,
 				   &raydium_i2c_attribute_group);
 	if (error) {
 		dev_err(&client->dev, "failed to create sysfs attributes: %d\n",
@@ -1128,15 +1121,6 @@ static int raydium_i2c_probe(struct i2c_client *client,
 		return error;
 	}
 
-	error = devm_add_action(&client->dev,
-				raydium_i2c_remove_sysfs_group, ts);
-	if (error) {
-		raydium_i2c_remove_sysfs_group(ts);
-		dev_err(&client->dev,
-			"Failed to add sysfs cleanup action: %d\n", error);
-		return error;
-	}
-
 	return 0;
 }
 
-- 
2.14.2

[toc] | [prev] | [next] | [standalone]


#1742400 — Re: [PATCH 09/12] Input: raydium_i2c_ts - use managed devm_device_add_group

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2017-09-30 01:40 +0200
SubjectRe: [PATCH 09/12] Input: raydium_i2c_ts - use managed devm_device_add_group
Message-ID<uvd2W-4rw-11@gated-at.bofh.it>
In reply to#1742377
On Sat, Sep 30, 2017 at 05:38:36AM +0900, Andi Shyti wrote:
> Commit 57b8ff070f98 ("driver core: add devm_device_add_group()
> and friends") has added the the managed version for creating
> sysfs group files.
> 
> Use devm_device_add_group instead of sysfs_create_group and
> remove the action that cleans the sysfs file when exiting the
> driver.
> 
> Signed-off-by: Andi Shyti <andi@etezian.org>

Applied, thank you.

> ---
>  drivers/input/touchscreen/raydium_i2c_ts.c | 18 +-----------------
>  1 file changed, 1 insertion(+), 17 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c b/drivers/input/touchscreen/raydium_i2c_ts.c
> index 4f1d3fd5d412..100538d64fff 100644
> --- a/drivers/input/touchscreen/raydium_i2c_ts.c
> +++ b/drivers/input/touchscreen/raydium_i2c_ts.c
> @@ -943,13 +943,6 @@ static const struct attribute_group raydium_i2c_attribute_group = {
>  	.attrs = raydium_i2c_attributes,
>  };
>  
> -static void raydium_i2c_remove_sysfs_group(void *_data)
> -{
> -	struct raydium_data *ts = _data;
> -
> -	sysfs_remove_group(&ts->client->dev.kobj, &raydium_i2c_attribute_group);
> -}
> -
>  static int raydium_i2c_power_on(struct raydium_data *ts)
>  {
>  	int error;
> @@ -1120,7 +1113,7 @@ static int raydium_i2c_probe(struct i2c_client *client,
>  		return error;
>  	}
>  
> -	error = sysfs_create_group(&client->dev.kobj,
> +	error = devm_device_add_group(&client->dev,
>  				   &raydium_i2c_attribute_group);
>  	if (error) {
>  		dev_err(&client->dev, "failed to create sysfs attributes: %d\n",
> @@ -1128,15 +1121,6 @@ static int raydium_i2c_probe(struct i2c_client *client,
>  		return error;
>  	}
>  
> -	error = devm_add_action(&client->dev,
> -				raydium_i2c_remove_sysfs_group, ts);
> -	if (error) {
> -		raydium_i2c_remove_sysfs_group(ts);
> -		dev_err(&client->dev,
> -			"Failed to add sysfs cleanup action: %d\n", error);
> -		return error;
> -	}
> -
>  	return 0;
>  }
>  
> -- 
> 2.14.2
> 

-- 
Dmitry

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web