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


Groups > linux.kernel > #1464578 > unrolled thread

[PATCH 1/3] input: pixcir_i2c_ts: simplify code with of_device_get_match_data

Started byLABBE Corentin <clabbe.montjoie@gmail.com>
First post2016-08-17 15:30 +0200
Last post2016-08-19 19:20 +0200
Articles 6 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/3] input: pixcir_i2c_ts: simplify code with of_device_get_match_data LABBE Corentin <clabbe.montjoie@gmail.com> - 2016-08-17 15:30 +0200
    [PATCH 3/3] input: pixcir_i2c: Remove a useless blank line LABBE Corentin <clabbe.montjoie@gmail.com> - 2016-08-17 15:30 +0200
      Re: [PATCH 3/3] input: pixcir_i2c: Remove a useless blank line Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-08-19 19:20 +0200
    [PATCH 2/3] input: pixcir_i2c: Remove text about writing to Free Software Foundation LABBE Corentin <clabbe.montjoie@gmail.com> - 2016-08-17 15:30 +0200
      Re: [PATCH 2/3] input: pixcir_i2c: Remove text about writing to Free  Software Foundation Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-08-19 19:20 +0200
    Re: [PATCH 1/3] input: pixcir_i2c_ts: simplify code with  of_device_get_match_data Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-08-19 19:20 +0200

#1464578 — [PATCH 1/3] input: pixcir_i2c_ts: simplify code with of_device_get_match_data

FromLABBE Corentin <clabbe.montjoie@gmail.com>
Date2016-08-17 15:30 +0200
Subject[PATCH 1/3] input: pixcir_i2c_ts: simplify code with of_device_get_match_data
Message-ID<s794S-1zw-19@gated-at.bofh.it>
The usage of of_device_get_match_data reduce the code size a bit.
Furthermore, it is better to use a standard function for
getting the match data.

Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
---
 drivers/input/touchscreen/pixcir_i2c_ts.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c
index d159e14..b0a2dc2 100644
--- a/drivers/input/touchscreen/pixcir_i2c_ts.c
+++ b/drivers/input/touchscreen/pixcir_i2c_ts.c
@@ -431,13 +431,7 @@ static const struct of_device_id pixcir_of_match[];
 static int pixcir_parse_dt(struct device *dev,
 			   struct pixcir_i2c_ts_data *tsdata)
 {
-	const struct of_device_id *match;
-
-	match = of_match_device(of_match_ptr(pixcir_of_match), dev);
-	if (!match)
-		return -EINVAL;
-
-	tsdata->chip = (const struct pixcir_i2c_chip_data *)match->data;
+	tsdata->chip = of_device_get_match_data(dev);
 	if (!tsdata->chip)
 		return -EINVAL;
 
-- 
2.7.3

[toc] | [next] | [standalone]


#1464580 — [PATCH 3/3] input: pixcir_i2c: Remove a useless blank line

FromLABBE Corentin <clabbe.montjoie@gmail.com>
Date2016-08-17 15:30 +0200
Subject[PATCH 3/3] input: pixcir_i2c: Remove a useless blank line
Message-ID<s794S-1zw-23@gated-at.bofh.it>
In reply to#1464578
This patch fix the following checkpatch report:
Blank lines aren't necessary after an open brace

Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
---
 drivers/input/touchscreen/pixcir_i2c_ts.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c
index d8b8889..3bb0637 100644
--- a/drivers/input/touchscreen/pixcir_i2c_ts.c
+++ b/drivers/input/touchscreen/pixcir_i2c_ts.c
@@ -400,7 +400,6 @@ static int __maybe_unused pixcir_i2c_ts_resume(struct device *dev)
 	mutex_lock(&input->mutex);
 
 	if (device_may_wakeup(&client->dev)) {
-
 		if (!input->users) {
 			ret = pixcir_stop(ts);
 			if (ret) {
-- 
2.7.3

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


#1466573 — Re: [PATCH 3/3] input: pixcir_i2c: Remove a useless blank line

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2016-08-19 19:20 +0200
SubjectRe: [PATCH 3/3] input: pixcir_i2c: Remove a useless blank line
Message-ID<s7VCy-8rz-19@gated-at.bofh.it>
In reply to#1464580
On Wed, Aug 17, 2016 at 03:22:14PM +0200, LABBE Corentin wrote:
> This patch fix the following checkpatch report:
> Blank lines aren't necessary after an open brace
> 
> Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>

Hmm, OK.

Applied, thank you.

> ---
>  drivers/input/touchscreen/pixcir_i2c_ts.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c
> index d8b8889..3bb0637 100644
> --- a/drivers/input/touchscreen/pixcir_i2c_ts.c
> +++ b/drivers/input/touchscreen/pixcir_i2c_ts.c
> @@ -400,7 +400,6 @@ static int __maybe_unused pixcir_i2c_ts_resume(struct device *dev)
>  	mutex_lock(&input->mutex);
>  
>  	if (device_may_wakeup(&client->dev)) {
> -
>  		if (!input->users) {
>  			ret = pixcir_stop(ts);
>  			if (ret) {
> -- 
> 2.7.3
> 

-- 
Dmitry

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


#1464582 — [PATCH 2/3] input: pixcir_i2c: Remove text about writing to Free Software Foundation

FromLABBE Corentin <clabbe.montjoie@gmail.com>
Date2016-08-17 15:30 +0200
Subject[PATCH 2/3] input: pixcir_i2c: Remove text about writing to Free Software Foundation
Message-ID<s794S-1zw-27@gated-at.bofh.it>
In reply to#1464578
Checkpatch complains about the text suggesting writing to
Free Software Foundation for GPLv2 license copy.
This patch remove that text.

Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
---
 drivers/input/touchscreen/pixcir_i2c_ts.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c
index b0a2dc2..d8b8889 100644
--- a/drivers/input/touchscreen/pixcir_i2c_ts.c
+++ b/drivers/input/touchscreen/pixcir_i2c_ts.c
@@ -11,10 +11,6 @@
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
 #include <linux/delay.h>
-- 
2.7.3

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


#1466567 — Re: [PATCH 2/3] input: pixcir_i2c: Remove text about writing to Free Software Foundation

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2016-08-19 19:20 +0200
SubjectRe: [PATCH 2/3] input: pixcir_i2c: Remove text about writing to Free Software Foundation
Message-ID<s7VCx-8rz-5@gated-at.bofh.it>
In reply to#1464582
On Wed, Aug 17, 2016 at 03:22:13PM +0200, LABBE Corentin wrote:
> Checkpatch complains about the text suggesting writing to
> Free Software Foundation for GPLv2 license copy.
> This patch remove that text.
> 
> Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>

Applied, thank you.

> ---
>  drivers/input/touchscreen/pixcir_i2c_ts.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c
> index b0a2dc2..d8b8889 100644
> --- a/drivers/input/touchscreen/pixcir_i2c_ts.c
> +++ b/drivers/input/touchscreen/pixcir_i2c_ts.c
> @@ -11,10 +11,6 @@
>   * but WITHOUT ANY WARRANTY; without even the implied warranty of
>   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>   * GNU General Public License for more details.
> - *
> - * You should have received a copy of the GNU General Public
> - * License along with this library; if not, write to the Free Software
> - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
>   */
>  
>  #include <linux/delay.h>
> -- 
> 2.7.3
> 

-- 
Dmitry

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


#1466569 — Re: [PATCH 1/3] input: pixcir_i2c_ts: simplify code with of_device_get_match_data

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2016-08-19 19:20 +0200
SubjectRe: [PATCH 1/3] input: pixcir_i2c_ts: simplify code with of_device_get_match_data
Message-ID<s7VCx-8rz-11@gated-at.bofh.it>
In reply to#1464578
On Wed, Aug 17, 2016 at 03:22:12PM +0200, LABBE Corentin wrote:
> The usage of of_device_get_match_data reduce the code size a bit.
> Furthermore, it is better to use a standard function for
> getting the match data.
> 
> Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>

Applied, thank you.

> ---
>  drivers/input/touchscreen/pixcir_i2c_ts.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c
> index d159e14..b0a2dc2 100644
> --- a/drivers/input/touchscreen/pixcir_i2c_ts.c
> +++ b/drivers/input/touchscreen/pixcir_i2c_ts.c
> @@ -431,13 +431,7 @@ static const struct of_device_id pixcir_of_match[];
>  static int pixcir_parse_dt(struct device *dev,
>  			   struct pixcir_i2c_ts_data *tsdata)
>  {
> -	const struct of_device_id *match;
> -
> -	match = of_match_device(of_match_ptr(pixcir_of_match), dev);
> -	if (!match)
> -		return -EINVAL;
> -
> -	tsdata->chip = (const struct pixcir_i2c_chip_data *)match->data;
> +	tsdata->chip = of_device_get_match_data(dev);
>  	if (!tsdata->chip)
>  		return -EINVAL;
>  
> -- 
> 2.7.3
> 

-- 
Dmitry

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web