Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH 3/7] Input: pxa27x_keypad - Include linux/of.h header
From: Sachin Kamat @ 2013-09-27 11:52 UTC (permalink / raw)
  To: linux-input; +Cc: dmitry.torokhov, sachin.kamat
In-Reply-To: <1380282729-26669-1-git-send-email-sachin.kamat@linaro.org>

'of_match_ptr' is defined in linux/of.h. Include it explicitly.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/input/keyboard/pxa27x_keypad.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c
index a2e758d..186138c 100644
--- a/drivers/input/keyboard/pxa27x_keypad.c
+++ b/drivers/input/keyboard/pxa27x_keypad.c
@@ -27,6 +27,7 @@
 #include <linux/err.h>
 #include <linux/input/matrix_keypad.h>
 #include <linux/slab.h>
+#include <linux/of.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 4/7] Input: pwm-beeper - Include linux/of.h header
From: Sachin Kamat @ 2013-09-27 11:52 UTC (permalink / raw)
  To: linux-input; +Cc: dmitry.torokhov, sachin.kamat
In-Reply-To: <1380282729-26669-1-git-send-email-sachin.kamat@linaro.org>

'of_match_ptr' is defined in linux/of.h. Include it explicitly.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/input/misc/pwm-beeper.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/misc/pwm-beeper.c b/drivers/input/misc/pwm-beeper.c
index 2ff4d1c..940566e 100644
--- a/drivers/input/misc/pwm-beeper.c
+++ b/drivers/input/misc/pwm-beeper.c
@@ -16,6 +16,7 @@
 #include <linux/input.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/pwm.h>
 #include <linux/slab.h>
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 5/7] Input: rotary_encoder - Include linux/of.h header
From: Sachin Kamat @ 2013-09-27 11:52 UTC (permalink / raw)
  To: linux-input; +Cc: dmitry.torokhov, sachin.kamat
In-Reply-To: <1380282729-26669-1-git-send-email-sachin.kamat@linaro.org>

'of_match_ptr' is defined in linux/of.h. Include it explicitly.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/input/misc/rotary_encoder.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/misc/rotary_encoder.c b/drivers/input/misc/rotary_encoder.c
index 5b1aff8..f920ba7 100644
--- a/drivers/input/misc/rotary_encoder.c
+++ b/drivers/input/misc/rotary_encoder.c
@@ -24,6 +24,7 @@
 #include <linux/gpio.h>
 #include <linux/rotary_encoder.h>
 #include <linux/slab.h>
+#include <linux/of.h>
 #include <linux/of_platform.h>
 #include <linux/of_gpio.h>
 
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 6/7] Input: egalax_ts - Include linux/of.h header
From: Sachin Kamat @ 2013-09-27 11:52 UTC (permalink / raw)
  To: linux-input; +Cc: dmitry.torokhov, sachin.kamat
In-Reply-To: <1380282729-26669-1-git-send-email-sachin.kamat@linaro.org>

'of_match_ptr' is defined in linux/of.h. Include it explicitly.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/input/touchscreen/egalax_ts.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c
index ef5fcb0..c856fbc 100644
--- a/drivers/input/touchscreen/egalax_ts.c
+++ b/drivers/input/touchscreen/egalax_ts.c
@@ -28,6 +28,7 @@
 #include <linux/slab.h>
 #include <linux/bitops.h>
 #include <linux/input/mt.h>
+#include <linux/of.h>
 #include <linux/of_gpio.h>
 
 /*
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 7/7] Input: st1232 - Include linux/of.h header
From: Sachin Kamat @ 2013-09-27 11:52 UTC (permalink / raw)
  To: linux-input; +Cc: dmitry.torokhov, sachin.kamat
In-Reply-To: <1380282729-26669-1-git-send-email-sachin.kamat@linaro.org>

'of_match_ptr' is defined in linux/of.h. Include it explicitly.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/input/touchscreen/st1232.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c
index 1740a24..2f03b2f 100644
--- a/drivers/input/touchscreen/st1232.c
+++ b/drivers/input/touchscreen/st1232.c
@@ -24,6 +24,7 @@
 #include <linux/input.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/of_gpio.h>
 #include <linux/pm_qos.h>
 #include <linux/slab.h>
-- 
1.7.9.5


^ permalink raw reply related

* Re: [v3.11][Regression] HID: hyperv: convert alloc+memcpy to memdup
From: Joseph Salisbury @ 2013-09-27 14:42 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: list, Haiyang Zhang, LKML, open, Dan Carpenter, HID CORE LAYER,
	devel, thomas
In-Reply-To: <alpine.LNX.2.00.1309271250130.18703@pobox.suse.cz>

On 09/27/2013 06:50 AM, Jiri Kosina wrote:
> On Wed, 25 Sep 2013, Joseph Salisbury wrote:
>
>> After further testing reverting the following commit does in fact
>> resolve the bug:
>>
>> commit b1a1442a23776756b254b69786848a94d92445ba
>> Author: Jiri Kosina <jkosina@suse.cz>
>> Date: Mon Jun 3 11:27:48 2013 +0200
>>
>>     HID: core: fix reporting of raw events
>>
>> Reverting this commit in v3.12-rc2 prevents the system from locking up, 
>> which happens when connecting a bluetooth trackpad.
>>
>> Jiri, do you think we should revert this patch, or is there some further 
>> debugging/data collecting you would like to do?
> Hi Joseph,
>
> in this mail:
>
> 	Message-ID: <5241992E.3090805@canonical.com>
> 	Date: Tue, 24 Sep 2013 09:52:46 -0400
>
> you said that reverting this commit doesn't prevent the lockups, so I am 
> rather confused ... ?
>
> Thanks,
>
The testing was invalid.  Reverting commit b1a1442 does resolve the bug
and stop the lockups.

Thanks,

Joe

^ permalink raw reply

* Re: [v3.11][Regression] HID: hyperv: convert alloc+memcpy to memdup
From: Dan Carpenter @ 2013-09-27 15:24 UTC (permalink / raw)
  To: Joseph Salisbury
  Cc: list, Jiri Kosina, Haiyang Zhang, LKML, open, HID CORE LAYER,
	devel, thomas
In-Reply-To: <52459942.3020600@canonical.com>

On Fri, Sep 27, 2013 at 10:42:10AM -0400, Joseph Salisbury wrote:
> On 09/27/2013 06:50 AM, Jiri Kosina wrote:
> > On Wed, 25 Sep 2013, Joseph Salisbury wrote:
> >
> >> After further testing reverting the following commit does in fact
> >> resolve the bug:
> >>
> >> commit b1a1442a23776756b254b69786848a94d92445ba
> >> Author: Jiri Kosina <jkosina@suse.cz>
> >> Date: Mon Jun 3 11:27:48 2013 +0200
> >>
> >>     HID: core: fix reporting of raw events
> >>
> >> Reverting this commit in v3.12-rc2 prevents the system from locking up, 
> >> which happens when connecting a bluetooth trackpad.
> >>
> >> Jiri, do you think we should revert this patch, or is there some further 
> >> debugging/data collecting you would like to do?
> > Hi Joseph,
> >
> > in this mail:
> >
> > 	Message-ID: <5241992E.3090805@canonical.com>
> > 	Date: Tue, 24 Sep 2013 09:52:46 -0400
> >
> > you said that reverting this commit doesn't prevent the lockups, so I am 
> > rather confused ... ?
> >
> > Thanks,
> >
> The testing was invalid.  Reverting commit b1a1442 does resolve the bug
> and stop the lockups.
> 

It looks like magicmouse_raw_event() returns 1 on success and 0 on
failure.

regards,
dan carpenter

^ permalink raw reply

* Re: [v3.11][Regression] HID: hyperv: convert alloc+memcpy to memdup
From: Dan Carpenter @ 2013-09-27 15:59 UTC (permalink / raw)
  To: Joseph Salisbury
  Cc: Jiri Kosina, list, Haiyang Zhang, LKML, open, HID CORE LAYER,
	devel, thomas
In-Reply-To: <20130927152412.GF6192@mwanda>

On Fri, Sep 27, 2013 at 06:24:12PM +0300, Dan Carpenter wrote:
> 
> It looks like magicmouse_raw_event() returns 1 on success and 0 on
> failure.

Fixing the return codes is a good idea but it won't fix the oops.

What's the point of returning 1 and 0?  In the current code no one
cares and both are treated the same.

Also if we decide to fix this instead of reverting the we could do this
cleanup as well:

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index b8470b1..868ebaa 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1417,10 +1417,8 @@ int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int i
 
 	if (hdrv && hdrv->raw_event && hid_match_report(hid, report)) {
 		ret = hdrv->raw_event(hid, report, data, size);
-		if (ret < 0) {
-			ret = ret < 0 ? ret : 0;
+		if (ret < 0)
 			goto unlock;
-		}
 	}
 
 	ret = hid_report_raw_event(hid, type, data, size, interrupt);

^ permalink raw reply related

* [PATCH] HID: roccat: Fix "cannot create duplicate filename" problems
From: Stefan Achatz @ 2013-09-28  3:57 UTC (permalink / raw)
  To: Jiri Kosina, linux-input, linux-kernel; +Cc: Greg KH

Fixing some wrong macro stringification/concatenation.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
---
 drivers/hid/hid-roccat-kone.c     |    2 +-
 drivers/hid/hid-roccat-koneplus.c |    4 ++--
 drivers/hid/hid-roccat-kovaplus.c |    4 ++--
 drivers/hid/hid-roccat-pyra.c     |    4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/hid/hid-roccat-kone.c b/drivers/hid/hid-roccat-kone.c
index 602c188..6101816 100644
--- a/drivers/hid/hid-roccat-kone.c
+++ b/drivers/hid/hid-roccat-kone.c
@@ -382,7 +382,7 @@ static ssize_t kone_sysfs_write_profilex(struct file *fp,
 }
 #define PROFILE_ATTR(number)					\
 static struct bin_attribute bin_attr_profile##number = {	\
-	.attr = { .name = "profile##number", .mode = 0660 },	\
+	.attr = { .name = "profile" #number, .mode = 0660 },	\
 	.size = sizeof(struct kone_profile),			\
 	.read = kone_sysfs_read_profilex,			\
 	.write = kone_sysfs_write_profilex,			\
diff --git a/drivers/hid/hid-roccat-koneplus.c b/drivers/hid/hid-roccat-koneplus.c
index 5ddf605..5e99fcd 100644
--- a/drivers/hid/hid-roccat-koneplus.c
+++ b/drivers/hid/hid-roccat-koneplus.c
@@ -229,13 +229,13 @@ static ssize_t koneplus_sysfs_read_profilex_buttons(struct file *fp,
 
 #define PROFILE_ATTR(number)						\
 static struct bin_attribute bin_attr_profile##number##_settings = {	\
-	.attr = { .name = "profile##number##_settings", .mode = 0440 },	\
+	.attr = { .name = "profile" #number "_settings", .mode = 0440 },	\
 	.size = KONEPLUS_SIZE_PROFILE_SETTINGS,				\
 	.read = koneplus_sysfs_read_profilex_settings,			\
 	.private = &profile_numbers[number-1],				\
 };									\
 static struct bin_attribute bin_attr_profile##number##_buttons = {	\
-	.attr = { .name = "profile##number##_buttons", .mode = 0440 },	\
+	.attr = { .name = "profile" #number "_buttons", .mode = 0440 },	\
 	.size = KONEPLUS_SIZE_PROFILE_BUTTONS,				\
 	.read = koneplus_sysfs_read_profilex_buttons,			\
 	.private = &profile_numbers[number-1],				\
diff --git a/drivers/hid/hid-roccat-kovaplus.c b/drivers/hid/hid-roccat-kovaplus.c
index 515bc03..0c8e1ef 100644
--- a/drivers/hid/hid-roccat-kovaplus.c
+++ b/drivers/hid/hid-roccat-kovaplus.c
@@ -257,13 +257,13 @@ static ssize_t kovaplus_sysfs_read_profilex_buttons(struct file *fp,
 
 #define PROFILE_ATTR(number)						\
 static struct bin_attribute bin_attr_profile##number##_settings = {	\
-	.attr = { .name = "profile##number##_settings", .mode = 0440 },	\
+	.attr = { .name = "profile" #number "_settings", .mode = 0440 },	\
 	.size = KOVAPLUS_SIZE_PROFILE_SETTINGS,				\
 	.read = kovaplus_sysfs_read_profilex_settings,			\
 	.private = &profile_numbers[number-1],				\
 };									\
 static struct bin_attribute bin_attr_profile##number##_buttons = {	\
-	.attr = { .name = "profile##number##_buttons", .mode = 0440 },	\
+	.attr = { .name = "profile" #number "_buttons", .mode = 0440 },	\
 	.size = KOVAPLUS_SIZE_PROFILE_BUTTONS,				\
 	.read = kovaplus_sysfs_read_profilex_buttons,			\
 	.private = &profile_numbers[number-1],				\
diff --git a/drivers/hid/hid-roccat-pyra.c b/drivers/hid/hid-roccat-pyra.c
index 5a6dbbe..1a07e07 100644
--- a/drivers/hid/hid-roccat-pyra.c
+++ b/drivers/hid/hid-roccat-pyra.c
@@ -225,13 +225,13 @@ static ssize_t pyra_sysfs_read_profilex_buttons(struct file *fp,
 
 #define PROFILE_ATTR(number)						\
 static struct bin_attribute bin_attr_profile##number##_settings = {	\
-	.attr = { .name = "profile##number##_settings", .mode = 0440 },	\
+	.attr = { .name = "profile" #number "_settings", .mode = 0440 },	\
 	.size = PYRA_SIZE_PROFILE_SETTINGS,				\
 	.read = pyra_sysfs_read_profilex_settings,			\
 	.private = &profile_numbers[number-1],				\
 };									\
 static struct bin_attribute bin_attr_profile##number##_buttons = {	\
-	.attr = { .name = "profile##number##_buttons", .mode = 0440 },	\
+	.attr = { .name = "profile" #number "_buttons", .mode = 0440 },	\
 	.size = PYRA_SIZE_PROFILE_BUTTONS,				\
 	.read = pyra_sysfs_read_profilex_buttons,			\
 	.private = &profile_numbers[number-1],				\
-- 
1.7.3.4




^ permalink raw reply related

* Re: [PATCH] HID: roccat: Fix "cannot create duplicate filename" problems
From: Greg KH @ 2013-09-28  4:02 UTC (permalink / raw)
  To: Stefan Achatz; +Cc: Jiri Kosina, linux-input, linux-kernel
In-Reply-To: <1380340666.2451.4.camel@neuromancer.tessier-ashpool>

On Sat, Sep 28, 2013 at 05:57:46AM +0200, Stefan Achatz wrote:
> Fixing some wrong macro stringification/concatenation.
> 
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
> ---
>  drivers/hid/hid-roccat-kone.c     |    2 +-
>  drivers/hid/hid-roccat-koneplus.c |    4 ++--
>  drivers/hid/hid-roccat-kovaplus.c |    4 ++--
>  drivers/hid/hid-roccat-pyra.c     |    4 ++--
>  4 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/hid/hid-roccat-kone.c b/drivers/hid/hid-roccat-kone.c
> index 602c188..6101816 100644
> --- a/drivers/hid/hid-roccat-kone.c
> +++ b/drivers/hid/hid-roccat-kone.c
> @@ -382,7 +382,7 @@ static ssize_t kone_sysfs_write_profilex(struct file *fp,
>  }
>  #define PROFILE_ATTR(number)					\
>  static struct bin_attribute bin_attr_profile##number = {	\
> -	.attr = { .name = "profile##number", .mode = 0660 },	\
> +	.attr = { .name = "profile" #number, .mode = 0660 },	\

Ugh, very sorry about that, I hate macros in C at times :)

Jiri, can you take this through your tree, or I can if you want, it
needs to go in for 3.12-final.

If yours, feel free to add:

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Stefan, thanks for fixing my bugs, it's much appreciated.

greg k-h

^ permalink raw reply

* Re: [PATCH 6/7] Input: egalax_ts - Include linux/of.h header
From: Sachin Kamat @ 2013-09-28 12:17 UTC (permalink / raw)
  To: linux-input@vger.kernel.org; +Cc: Dmitry Torokhov, Sachin Kamat
In-Reply-To: <1380282729-26669-6-git-send-email-sachin.kamat@linaro.org>

Hi Dmitry,

On 27 September 2013 17:22, Sachin Kamat <sachin.kamat@linaro.org> wrote:
> 'of_match_ptr' is defined in linux/of.h. Include it explicitly.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---

Please drop this patch. I will send a different one for this.

-- 
With warm regards,
Sachin

^ permalink raw reply

* [PATCH 1/6] Input: lpc32xx-keys - Remove redundant of_match_ptr
From: Sachin Kamat @ 2013-09-28 12:28 UTC (permalink / raw)
  To: linux-input; +Cc: dmitry.torokhov, sachin.kamat

The data structure of_match_ptr() protects is always compiled in.
Hence of_match_ptr() is not needed.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/input/keyboard/lpc32xx-keys.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/lpc32xx-keys.c b/drivers/input/keyboard/lpc32xx-keys.c
index 4218143..8b1b013 100644
--- a/drivers/input/keyboard/lpc32xx-keys.c
+++ b/drivers/input/keyboard/lpc32xx-keys.c
@@ -383,7 +383,7 @@ static struct platform_driver lpc32xx_kscan_driver = {
 		.name	= DRV_NAME,
 		.owner	= THIS_MODULE,
 		.pm	= &lpc32xx_kscan_pm_ops,
-		.of_match_table = of_match_ptr(lpc32xx_kscan_match),
+		.of_match_table = lpc32xx_kscan_match,
 	}
 };
 
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 2/6] Input: nspire-keypad - Remove redundant of_match_ptr
From: Sachin Kamat @ 2013-09-28 12:28 UTC (permalink / raw)
  To: linux-input; +Cc: dmitry.torokhov, sachin.kamat
In-Reply-To: <1380371294-10289-1-git-send-email-sachin.kamat@linaro.org>

The data structure of_match_ptr() protects is always compiled in.
Hence of_match_ptr() is not needed.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/input/keyboard/nspire-keypad.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/nspire-keypad.c b/drivers/input/keyboard/nspire-keypad.c
index b3e3eda..9981928 100644
--- a/drivers/input/keyboard/nspire-keypad.c
+++ b/drivers/input/keyboard/nspire-keypad.c
@@ -267,7 +267,7 @@ static struct platform_driver nspire_keypad_driver = {
 	.driver = {
 		.name = "nspire-keypad",
 		.owner = THIS_MODULE,
-		.of_match_table = of_match_ptr(nspire_keypad_dt_match),
+		.of_match_table = nspire_keypad_dt_match,
 	},
 	.probe = nspire_keypad_probe,
 };
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 3/6] Input: tegra-kbc - Remove redundant of_match_ptr
From: Sachin Kamat @ 2013-09-28 12:28 UTC (permalink / raw)
  To: linux-input; +Cc: dmitry.torokhov, sachin.kamat
In-Reply-To: <1380371294-10289-1-git-send-email-sachin.kamat@linaro.org>

The data structure of_match_ptr() protects is always compiled in.
Hence of_match_ptr() is not needed.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/input/keyboard/tegra-kbc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
index 9cd20e6..8508879 100644
--- a/drivers/input/keyboard/tegra-kbc.c
+++ b/drivers/input/keyboard/tegra-kbc.c
@@ -614,7 +614,7 @@ static int tegra_kbc_probe(struct platform_device *pdev)
 	unsigned int keymap_rows;
 	const struct of_device_id *match;
 
-	match = of_match_device(of_match_ptr(tegra_kbc_of_match), &pdev->dev);
+	match = of_match_device(tegra_kbc_of_match, &pdev->dev);
 
 	kbc = devm_kzalloc(&pdev->dev, sizeof(*kbc), GFP_KERNEL);
 	if (!kbc) {
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 4/6] Input: sirfsoc-onkey - Remove redundant of_match_ptr
From: Sachin Kamat @ 2013-09-28 12:28 UTC (permalink / raw)
  To: linux-input; +Cc: dmitry.torokhov, sachin.kamat
In-Reply-To: <1380371294-10289-1-git-send-email-sachin.kamat@linaro.org>

The data structure of_match_ptr() protects is always compiled in.
Hence of_match_ptr() is not needed.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/input/misc/sirfsoc-onkey.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/misc/sirfsoc-onkey.c b/drivers/input/misc/sirfsoc-onkey.c
index 0621c36..7b8b03e 100644
--- a/drivers/input/misc/sirfsoc-onkey.c
+++ b/drivers/input/misc/sirfsoc-onkey.c
@@ -153,7 +153,7 @@ static struct platform_driver sirfsoc_pwrc_driver = {
 		.name	= "sirfsoc-pwrc",
 		.owner	= THIS_MODULE,
 		.pm	= &sirfsoc_pwrc_pm_ops,
-		.of_match_table = of_match_ptr(sirfsoc_pwrc_of_match),
+		.of_match_table = sirfsoc_pwrc_of_match,
 	}
 };
 
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 5/6] Input: egalax_ts - Remove redundant of_match_ptr
From: Sachin Kamat @ 2013-09-28 12:28 UTC (permalink / raw)
  To: linux-input; +Cc: dmitry.torokhov, sachin.kamat
In-Reply-To: <1380371294-10289-1-git-send-email-sachin.kamat@linaro.org>

The data structure of_match_ptr() protects is always compiled in.
Hence of_match_ptr() is not needed.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/input/touchscreen/egalax_ts.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c
index c856fbc..b4d721f 100644
--- a/drivers/input/touchscreen/egalax_ts.c
+++ b/drivers/input/touchscreen/egalax_ts.c
@@ -274,7 +274,7 @@ static struct i2c_driver egalax_ts_driver = {
 		.name	= "egalax_ts",
 		.owner	= THIS_MODULE,
 		.pm	= &egalax_ts_pm_ops,
-		.of_match_table	= of_match_ptr(egalax_ts_dt_ids),
+		.of_match_table	= egalax_ts_dt_ids,
 	},
 	.id_table	= egalax_ts_id,
 	.probe		= egalax_ts_probe,
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 6/6] Input: ti_am335x_tsc - Remove redundant of_match_ptr
From: Sachin Kamat @ 2013-09-28 12:28 UTC (permalink / raw)
  To: linux-input; +Cc: dmitry.torokhov, sachin.kamat
In-Reply-To: <1380371294-10289-1-git-send-email-sachin.kamat@linaro.org>

The data structure of_match_ptr() protects is always compiled in.
Hence of_match_ptr() is not needed.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/input/touchscreen/ti_am335x_tsc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c
index 24e625c..14b7390 100644
--- a/drivers/input/touchscreen/ti_am335x_tsc.c
+++ b/drivers/input/touchscreen/ti_am335x_tsc.c
@@ -511,7 +511,7 @@ static struct platform_driver ti_tsc_driver = {
 		.name   = "TI-am335x-tsc",
 		.owner	= THIS_MODULE,
 		.pm	= TITSC_PM_OPS,
-		.of_match_table = of_match_ptr(ti_tsc_dt_ids),
+		.of_match_table = ti_tsc_dt_ids,
 	},
 };
 module_platform_driver(ti_tsc_driver);
-- 
1.7.9.5


^ permalink raw reply related

* [RFC/PATCH 0/1] rotary-encoder: Add new interruption handler
From: Ezequiel Garcia @ 2013-09-28 18:26 UTC (permalink / raw)
  To: linux-input; +Cc: Ezequiel Garcia, Daniel Mack, Dmitry Torokhov

Some rotary-encoder devices (such as those with detents) are capable
of producing a stable event on each step. This simple patch adds support
for this case, by implementing a new interruption handler.

The handler needs only detect the direction of the turn and generate
an event according to this detection.

We encode the previous and the current state, and then use the sum of them
to decide on the direction of the turn, according to the following simple
table:

Previous state + currrent state	| Movement
==========================================
	0b1101			| clockwise
	0b0100			|   ..
	0b0010			|   ..
	0b1011			|   ..
==========================================
	0b1110			| counter-clockwise
	0b0111			|   ..
	0b0001			|   ..
	0b1000			|   ..

(The other sumed values are considered illegal)

This calculation is based on some previous work found at this blog:

  http://bildr.org/2012/08/rotary-encoder-arduino/

The result is a seemingly very robust behavior, with a truly simple
implementation, that produces an event on each turn of the device.

I don't have much experience with this rotary-encoder devices, so I'm sending
this just as an RFC/PATCH, to get some early feedback. In particular, I got a
bit puzzled by the current implementation with 'armed' and 'dis-armed'.
Maybe there's some way of using the current driver and get an event on each turn?

If this change looks more or less acceptable, I can add device-tree bindings
(which are missing from this first patch) and re-send.

Thanks!

Ezequiel Garcia (1):
  Input: rotary-encoder: Add 'stepped' irq handler

 drivers/input/misc/rotary_encoder.c | 34 ++++++++++++++++++++++++++++++++++
 include/linux/rotary_encoder.h      |  1 +
 2 files changed, 35 insertions(+)

-- 
1.8.1.5


^ permalink raw reply

* [PATCH 1/1] Input: rotary-encoder: Add 'stepped' irq handler
From: Ezequiel Garcia @ 2013-09-28 18:26 UTC (permalink / raw)
  To: linux-input; +Cc: Ezequiel Garcia, Daniel Mack, Dmitry Torokhov
In-Reply-To: <1380392798-23345-1-git-send-email-ezequiel@vanguardiasur.com.ar>

Some rotary-encoder devices (such as those with detents) are capable
of producing a stable event on each step. This commit adds support
for this case, by implementing a new interruption handler.

The handler needs only detect the direction of the turn and generate
an event according to this detection.

Cc: Daniel Mack <zonque@gmail.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
---
 drivers/input/misc/rotary_encoder.c | 34 ++++++++++++++++++++++++++++++++++
 include/linux/rotary_encoder.h      |  1 +
 2 files changed, 35 insertions(+)

diff --git a/drivers/input/misc/rotary_encoder.c b/drivers/input/misc/rotary_encoder.c
index 5b1aff8..8802221 100644
--- a/drivers/input/misc/rotary_encoder.c
+++ b/drivers/input/misc/rotary_encoder.c
@@ -117,6 +117,37 @@ static irqreturn_t rotary_encoder_irq(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
+static irqreturn_t rotary_encoder_stepped_irq(int irq, void *dev_id)
+{
+	struct rotary_encoder *encoder = dev_id;
+	int state, sum;
+
+	state = rotary_encoder_get_state(encoder->pdata);
+
+	/*
+	 * We encode the previous and the current state,
+	 * in the 'sum' variable and then use a table
+	 * to decide the direction of the turn.
+	 */
+	sum = (encoder->last_stable << 2) + state;
+	switch (sum) {
+	case 0b1101:
+	case 0b0100:
+	case 0b0010:
+	case 0b1011:
+		encoder->dir = 0; /* clockwise */
+		break;
+	default:
+		encoder->dir = 1;
+	}
+
+	rotary_encoder_report_event(encoder);
+
+	encoder->last_stable = state;
+
+	return IRQ_HANDLED;
+}
+
 static irqreturn_t rotary_encoder_half_period_irq(int irq, void *dev_id)
 {
 	struct rotary_encoder *encoder = dev_id;
@@ -254,6 +285,9 @@ static int rotary_encoder_probe(struct platform_device *pdev)
 	if (pdata->half_period) {
 		handler = &rotary_encoder_half_period_irq;
 		encoder->last_stable = rotary_encoder_get_state(pdata);
+	} else if (pdata->on_each_step) {
+		handler = &rotary_encoder_stepped_irq;
+		encoder->last_stable = rotary_encoder_get_state(pdata);
 	} else {
 		handler = &rotary_encoder_irq;
 	}
diff --git a/include/linux/rotary_encoder.h b/include/linux/rotary_encoder.h
index 3f594dc..499f6f7 100644
--- a/include/linux/rotary_encoder.h
+++ b/include/linux/rotary_encoder.h
@@ -11,6 +11,7 @@ struct rotary_encoder_platform_data {
 	bool relative_axis;
 	bool rollover;
 	bool half_period;
+	bool on_each_step;
 };
 
 #endif /* __ROTARY_ENCODER_H__ */
-- 
1.8.1.5


^ permalink raw reply related

* How write driver for gamepad, that detected by usbhid but not work correctly?
From: v1kt0p.rus @ 2013-09-29  9:22 UTC (permalink / raw)
  To: linux-input

I have "Genesis to USB adapter" and two genesis gamepads. On windows it 
is work correctly. On linux do not work "left" and "up" buttons on 
D-pad, and two gamepads appear as one with double buttons.
At first I tried to write usb driver(usb_register), but when I connect 
gamepad system choose usbhid driver not my. When I unplug gamepad system 
call "probe" in my driver, but then immediately call "disconnect". Is 
there a way to force the system to choose my driver first?
Than I tried to write hid driver(hid_register_driver), but "probe" is 
not called. I can not find documentation describing how to make a 
working driver for hid, it exists at all?
What is the correct way to write a driver for the gamepad? What am I 
doing wrong?

^ permalink raw reply

* Re: How write driver for gamepad, that detected by usbhid but not work correctly?
From: Bruno Prémont @ 2013-09-29  9:39 UTC (permalink / raw)
  To: v1kt0p.rus@gmail.com; +Cc: linux-input
In-Reply-To: <5247F168.10008@gmail.com>

On Sun, 29 September 2013 "v1kt0p.rus@gmail.com" <v1kt0p.rus@gmail.com> wrote:
> I have "Genesis to USB adapter" and two genesis gamepads. On windows it 
> is work correctly. On linux do not work "left" and "up" buttons on 
> D-pad, and two gamepads appear as one with double buttons.
> At first I tried to write usb driver(usb_register), but when I connect 
> gamepad system choose usbhid driver not my. When I unplug gamepad system 
> call "probe" in my driver, but then immediately call "disconnect". Is 
> there a way to force the system to choose my driver first?
> Than I tried to write hid driver(hid_register_driver), but "probe" is 
> not called. I can not find documentation describing how to make a 
> working driver for hid, it exists at all?
> What is the correct way to write a driver for the gamepad? What am I 
> doing wrong?

You can have a look at all the drivers located under drivers/hid/ for
how they do it.

Two drivers that represent gamepads:
  hid-pl.c
  hid-saitek.c

Depending on how your gamepad shows up when there are two pads connected
you may need to register a second input device to send buttons from the
first pad to first input device, buttons from second to the extra input
device.

A good start to find out what your device does is to enable debugging
in your kernel and cat /sys/kernel/debug/hid/<your device>/events
to determine what happens on button presses.
You can then check how that output matches events sent from /dev/input/event*
matching your device and determine if all that is needed is proper
scancode translation of if more tuning is needed.

Bruno

^ permalink raw reply

* Re: [PATCH 1/1] Input: rotary-encoder: Add 'stepped' irq handler
From: Daniel Mack @ 2013-09-29 10:40 UTC (permalink / raw)
  To: Ezequiel Garcia; +Cc: linux-input, Dmitry Torokhov
In-Reply-To: <1380392798-23345-2-git-send-email-ezequiel@vanguardiasur.com.ar>

Hi Ezequiel,

On 28.09.2013 20:26, Ezequiel Garcia wrote:
> Some rotary-encoder devices (such as those with detents) are capable
> of producing a stable event on each step. This commit adds support
> for this case, by implementing a new interruption handler.
> 
> The handler needs only detect the direction of the turn and generate
> an event according to this detection.
> 

> +static irqreturn_t rotary_encoder_stepped_irq(int irq, void *dev_id)
> +{
> +	struct rotary_encoder *encoder = dev_id;
> +	int state, sum;
> +
> +	state = rotary_encoder_get_state(encoder->pdata);
> +
> +	/*
> +	 * We encode the previous and the current state,
> +	 * in the 'sum' variable and then use a table
> +	 * to decide the direction of the turn.
> +	 */
> +	sum = (encoder->last_stable << 2) + state;
> +	switch (sum) {
> +	case 0b1101:
> +	case 0b0100:
> +	case 0b0010:
> +	case 0b1011:

Binary constants are frowned upon, please avoid them in the kernel.
checkpatch.pl should have warned you about them as well.

> diff --git a/include/linux/rotary_encoder.h b/include/linux/rotary_encoder.h
> index 3f594dc..499f6f7 100644
> --- a/include/linux/rotary_encoder.h
> +++ b/include/linux/rotary_encoder.h
> @@ -11,6 +11,7 @@ struct rotary_encoder_platform_data {
>  	bool relative_axis;
>  	bool rollover;
>  	bool half_period;
> +	bool on_each_step;

Care to add a DT binding for this property as well?


Other than that, this looks good to me, but I can't test it due to the
lack of hardware.


Thanks,
Daniel


^ permalink raw reply

* Re: [PATCH 1/1] Input: rotary-encoder: Add 'stepped' irq handler
From: Ezequiel García @ 2013-09-29 17:29 UTC (permalink / raw)
  To: Daniel Mack; +Cc: linux-input, Dmitry Torokhov
In-Reply-To: <524803A9.5090708@gmail.com>

On 29 September 2013 07:40, Daniel Mack <zonque@gmail.com> wrote:
> Hi Ezequiel,
>
> On 28.09.2013 20:26, Ezequiel Garcia wrote:
>> Some rotary-encoder devices (such as those with detents) are capable
>> of producing a stable event on each step. This commit adds support
>> for this case, by implementing a new interruption handler.
>>
>> The handler needs only detect the direction of the turn and generate
>> an event according to this detection.
>>
>
>> +static irqreturn_t rotary_encoder_stepped_irq(int irq, void *dev_id)
>> +{
>> +     struct rotary_encoder *encoder = dev_id;
>> +     int state, sum;
>> +
>> +     state = rotary_encoder_get_state(encoder->pdata);
>> +
>> +     /*
>> +      * We encode the previous and the current state,
>> +      * in the 'sum' variable and then use a table
>> +      * to decide the direction of the turn.
>> +      */
>> +     sum = (encoder->last_stable << 2) + state;
>> +     switch (sum) {
>> +     case 0b1101:
>> +     case 0b0100:
>> +     case 0b0010:
>> +     case 0b1011:
>
> Binary constants are frowned upon, please avoid them in the kernel.
> checkpatch.pl should have warned you about them as well.
>

Well... despite any checkpatch.pl warnings, I think the above is much clear
to the reader than any alternative. The numbers encode the previous and current
gpio state, so the first two (LSB) bits have the current gpio's, while the other
two have the previous.

If binary values should be avoided by all means, then I would prefer to encode
the previous and current in different nibbles:

sum = (encoder->last_stable << 4) + state;
switch (sum) {
        case 0x31:
        case 0x10:
        case 0x02:
        case 0x23:

Maybe this is better?

>> diff --git a/include/linux/rotary_encoder.h b/include/linux/rotary_encoder.h
>> index 3f594dc..499f6f7 100644
>> --- a/include/linux/rotary_encoder.h
>> +++ b/include/linux/rotary_encoder.h
>> @@ -11,6 +11,7 @@ struct rotary_encoder_platform_data {
>>       bool relative_axis;
>>       bool rollover;
>>       bool half_period;
>> +     bool on_each_step;
>
> Care to add a DT binding for this property as well?
>

Sure, I was just waiting for your ACK before I did that.

>
> Other than that, this looks good to me, but I can't test it due to the
> lack of hardware.
>

OK.

I'm really curious about the rotary devices you originally used with
this driver.
I guess those have no detents, so there's no mechanical-click on each step?

Thanks,
-- 
Ezequiel García, VanguardiaSur
www.vanguardiasur.com.ar
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH 1/1] Input: rotary-encoder: Add 'stepped' irq handler
From: Daniel Mack @ 2013-09-29 17:39 UTC (permalink / raw)
  To: Ezequiel García; +Cc: linux-input, Dmitry Torokhov
In-Reply-To: <CAAEAJfDSW5rgGYXnL2Z_YUKUCVQ82BOg_Q5HtOKKpFvJAs5Qvw@mail.gmail.com>

On 29.09.2013 19:29, Ezequiel García wrote:
> On 29 September 2013 07:40, Daniel Mack <zonque@gmail.com> wrote:
>> On 28.09.2013 20:26, Ezequiel Garcia wrote:

>>> +     sum = (encoder->last_stable << 2) + state;
>>> +     switch (sum) {
>>> +     case 0b1101:
>>> +     case 0b0100:
>>> +     case 0b0010:
>>> +     case 0b1011:
>>
>> Binary constants are frowned upon, please avoid them in the kernel.
>> checkpatch.pl should have warned you about them as well.
>>
> 
> Well... despite any checkpatch.pl warnings, I think the above is much clear
> to the reader than any alternative.

The problem is that support for that notation is a proprietary gcc
extension that is AFAIK only supported from gcc 4.3 onwards or so.
However, the current minimum gcc version for building the kernel is 3.2.

> If binary values should be avoided by all means, then I would prefer to encode
> the previous and current in different nibbles:
> 
> sum = (encoder->last_stable << 4) + state;
> switch (sum) {
>         case 0x31:
>         case 0x10:
>         case 0x02:
>         case 0x23:
> 
> Maybe this is better?

Either that, or use
	case BIT(3) | BIT(2) | BIT(0):
		...

> I'm really curious about the rotary devices you originally used with
> this driver.
> I guess those have no detents, so there's no mechanical-click on each step?

Some models have detents, some don't. We've used one of this series
which does:


http://de.mouser.com/ProductDetail/Alpha-Taiwan/RE111F-20B3-20F-20P/?qs=yA6kp8fx8Y7KsyMOFz9p0A==



Best regards,
Daniel

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH] amba: Ensure drvdata is NULL
From: Michal Simek @ 2013-09-30  6:59 UTC (permalink / raw)
  To: linux-kernel, monstr
  Cc: Russell King, Dan Williams, Vinod Koul, Dmitry Torokhov,
	Chris Ball, Alessandro Zummo, Linus Walleij, Mark Brown,
	Greg Kroah-Hartman, Jiri Slaby, Jean-Christophe Plagniol-Villard,
	Tomi Valkeinen, Wim Van Sebroeck, Andrew Morton, zhangwei(Jovi),
	Randy Dunlap, linux-arm-kernel, linux-input, linux-mmc, rtc-linux,
	linux-spi, linux-serial, linux-fbdev, linux-watchdog

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

This patch is inpired by the patch for drvdata
"device-core: Ensure drvdata = NULL when no driver is bound"
(sha1: 0998d0631001288a5974afc0b2a5f568bcdecb4d)

Also it fixes all occurences in drivers.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
This patch has been sent as RFC in this thread.
http://lkml.org/lkml/2013/9/4/393

---
 arch/arm/kernel/etm.c           | 6 ------
 drivers/amba/bus.c              | 2 ++
 drivers/dma/pl330.c             | 3 ---
 drivers/input/serio/ambakmi.c   | 2 --
 drivers/mmc/host/mmci.c         | 2 --
 drivers/rtc/rtc-pl030.c         | 2 --
 drivers/rtc/rtc-pl031.c         | 2 --
 drivers/spi/spi-pl022.c         | 1 -
 drivers/tty/serial/amba-pl010.c | 3 ---
 drivers/tty/serial/amba-pl011.c | 3 ---
 drivers/video/amba-clcd.c       | 2 --
 drivers/watchdog/sp805_wdt.c    | 1 -
 12 files changed, 2 insertions(+), 27 deletions(-)

diff --git a/arch/arm/kernel/etm.c b/arch/arm/kernel/etm.c
index 8ff0ecd..131a6ab 100644
--- a/arch/arm/kernel/etm.c
+++ b/arch/arm/kernel/etm.c
@@ -385,7 +385,6 @@ out:
 	return ret;

 out_unmap:
-	amba_set_drvdata(dev, NULL);
 	iounmap(t->etb_regs);

 out_release:
@@ -398,8 +397,6 @@ static int etb_remove(struct amba_device *dev)
 {
 	struct tracectx *t = amba_get_drvdata(dev);

-	amba_set_drvdata(dev, NULL);
-
 	iounmap(t->etb_regs);
 	t->etb_regs = NULL;

@@ -588,7 +585,6 @@ out:
 	return ret;

 out_unmap:
-	amba_set_drvdata(dev, NULL);
 	iounmap(t->etm_regs);

 out_release:
@@ -601,8 +597,6 @@ static int etm_remove(struct amba_device *dev)
 {
 	struct tracectx *t = amba_get_drvdata(dev);

-	amba_set_drvdata(dev, NULL);
-
 	iounmap(t->etm_regs);
 	t->etm_regs = NULL;

diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index c670727..9762090 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -373,6 +373,7 @@ static int amba_probe(struct device *dev)
 		if (ret == 0)
 			break;

+		amba_set_drvdata(pcdev, NULL);
 		pm_runtime_disable(dev);
 		pm_runtime_set_suspended(dev);
 		pm_runtime_put_noidle(dev);
@@ -391,6 +392,7 @@ static int amba_remove(struct device *dev)

 	pm_runtime_get_sync(dev);
 	ret = drv->remove(pcdev);
+	amba_set_drvdata(pcdev, NULL);
 	pm_runtime_put_noidle(dev);

 	/* Undo the runtime PM settings in amba_probe() */
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index a562d24..dfb2931 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -3029,8 +3029,6 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)

 	return 0;
 probe_err3:
-	amba_set_drvdata(adev, NULL);
-
 	/* Idle the DMAC */
 	list_for_each_entry_safe(pch, _p, &pdmac->ddma.channels,
 			chan.device_node) {
@@ -3064,7 +3062,6 @@ static int pl330_remove(struct amba_device *adev)
 		of_dma_controller_free(adev->dev.of_node);

 	dma_async_device_unregister(&pdmac->ddma);
-	amba_set_drvdata(adev, NULL);

 	/* Idle the DMAC */
 	list_for_each_entry_safe(pch, _p, &pdmac->ddma.channels,
diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c
index 4e2fd44..b7c206d 100644
--- a/drivers/input/serio/ambakmi.c
+++ b/drivers/input/serio/ambakmi.c
@@ -167,8 +167,6 @@ static int amba_kmi_remove(struct amba_device *dev)
 {
 	struct amba_kmi_port *kmi = amba_get_drvdata(dev);

-	amba_set_drvdata(dev, NULL);
-
 	serio_unregister_port(kmi->io);
 	clk_put(kmi->clk);
 	iounmap(kmi->base);
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index c3785ed..07e17f1 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -1678,8 +1678,6 @@ static int mmci_remove(struct amba_device *dev)
 {
 	struct mmc_host *mmc = amba_get_drvdata(dev);

-	amba_set_drvdata(dev, NULL);
-
 	if (mmc) {
 		struct mmci_host *host = mmc_priv(mmc);

diff --git a/drivers/rtc/rtc-pl030.c b/drivers/rtc/rtc-pl030.c
index 22bacdb..a804f75 100644
--- a/drivers/rtc/rtc-pl030.c
+++ b/drivers/rtc/rtc-pl030.c
@@ -153,8 +153,6 @@ static int pl030_remove(struct amba_device *dev)
 {
 	struct pl030_rtc *rtc = amba_get_drvdata(dev);

-	amba_set_drvdata(dev, NULL);
-
 	writel(0, rtc->base + RTC_CR);

 	free_irq(dev->irq[0], rtc);
diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c
index 0f0609b..c9ca86e 100644
--- a/drivers/rtc/rtc-pl031.c
+++ b/drivers/rtc/rtc-pl031.c
@@ -305,7 +305,6 @@ static int pl031_remove(struct amba_device *adev)
 {
 	struct pl031_local *ldata = dev_get_drvdata(&adev->dev);

-	amba_set_drvdata(adev, NULL);
 	free_irq(adev->irq[0], ldata);
 	rtc_device_unregister(ldata->rtc);
 	iounmap(ldata->base);
@@ -392,7 +391,6 @@ out_no_irq:
 	rtc_device_unregister(ldata->rtc);
 out_no_rtc:
 	iounmap(ldata->base);
-	amba_set_drvdata(adev, NULL);
 out_no_remap:
 	kfree(ldata);
 out:
diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index 9c511a9..f661a7e 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -2288,7 +2288,6 @@ pl022_remove(struct amba_device *adev)
 	amba_release_regions(adev);
 	tasklet_disable(&pl022->pump_transfers);
 	spi_unregister_master(pl022->master);
-	amba_set_drvdata(adev, NULL);
 	return 0;
 }

diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl010.c
index 8b90f0b..33bd860 100644
--- a/drivers/tty/serial/amba-pl010.c
+++ b/drivers/tty/serial/amba-pl010.c
@@ -728,7 +728,6 @@ static int pl010_probe(struct amba_device *dev, const struct amba_id *id)
 	amba_set_drvdata(dev, uap);
 	ret = uart_add_one_port(&amba_reg, &uap->port);
 	if (ret) {
-		amba_set_drvdata(dev, NULL);
 		amba_ports[i] = NULL;
 		clk_put(uap->clk);
  unmap:
@@ -745,8 +744,6 @@ static int pl010_remove(struct amba_device *dev)
 	struct uart_amba_port *uap = amba_get_drvdata(dev);
 	int i;

-	amba_set_drvdata(dev, NULL);
-
 	uart_remove_one_port(&amba_reg, &uap->port);

 	for (i = 0; i < ARRAY_SIZE(amba_ports); i++)
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index aaa2286..7203864 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -2147,7 +2147,6 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
 	amba_set_drvdata(dev, uap);
 	ret = uart_add_one_port(&amba_reg, &uap->port);
 	if (ret) {
-		amba_set_drvdata(dev, NULL);
 		amba_ports[i] = NULL;
 		pl011_dma_remove(uap);
 	}
@@ -2160,8 +2159,6 @@ static int pl011_remove(struct amba_device *dev)
 	struct uart_amba_port *uap = amba_get_drvdata(dev);
 	int i;

-	amba_set_drvdata(dev, NULL);
-
 	uart_remove_one_port(&amba_reg, &uap->port);

 	for (i = 0; i < ARRAY_SIZE(amba_ports); i++)
diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c
index 0a2cce7..0bab6ab 100644
--- a/drivers/video/amba-clcd.c
+++ b/drivers/video/amba-clcd.c
@@ -594,8 +594,6 @@ static int clcdfb_remove(struct amba_device *dev)
 {
 	struct clcd_fb *fb = amba_get_drvdata(dev);

-	amba_set_drvdata(dev, NULL);
-
 	clcdfb_disable(fb);
 	unregister_framebuffer(&fb->fb);
 	if (fb->fb.cmap.len)
diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
index 58df98a..3f786ce 100644
--- a/drivers/watchdog/sp805_wdt.c
+++ b/drivers/watchdog/sp805_wdt.c
@@ -268,7 +268,6 @@ static int sp805_wdt_remove(struct amba_device *adev)
 	struct sp805_wdt *wdt = amba_get_drvdata(adev);

 	watchdog_unregister_device(&wdt->wdd);
-	amba_set_drvdata(adev, NULL);
 	watchdog_set_drvdata(&wdt->wdd, NULL);

 	return 0;
--
1.8.2.3


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

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox