All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Russell King <rmk+kernel@armlinux.org.uk>
Cc: Kristoffer Ericson <kristoffer.ericson@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-input@vger.kernel.org
Subject: Re: [PATCH 2/4] Input: jornada720_kbd - get rid of mach/irqs.h include
Date: Wed, 7 Sep 2016 19:24:40 -0700	[thread overview]
Message-ID: <20160908022440.GF6445@dtor-ws> (raw)
In-Reply-To: <E1bhZVd-0005cZ-5z@rmk-PC.armlinux.org.uk>

On Wed, Sep 07, 2016 at 10:51:09AM +0100, Russell King wrote:
> Switch the jornada720 keyboard driver to obtain its interrupt from the
> platform device, rather than via a hard-coded interrupt number obtained
> from the mach/irqs.h header.
> 
> Tested-by: Adam Wysocki <armlinux@chmurka.net>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

This has already been applied as well.

> ---
>  arch/arm/mach-sa1100/jornada720.c       |  6 ++++++
>  drivers/input/keyboard/jornada720_kbd.c | 11 +++++++----
>  2 files changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c
> index c0b1f5bafae4..2b96f7bc16bd 100644
> --- a/arch/arm/mach-sa1100/jornada720.c
> +++ b/arch/arm/mach-sa1100/jornada720.c
> @@ -217,9 +217,15 @@ static struct platform_device jornada_ssp_device = {
>  	.id             = -1,
>  };
>  
> +static struct resource jornada_kbd_resources[] = {
> +	DEFINE_RES_IRQ(IRQ_GPIO0),
> +};
> +
>  static struct platform_device jornada_kbd_device = {
>  	.name		= "jornada720_kbd",
>  	.id		= -1,
> +	.num_resources	= ARRAY_SIZE(jornada_kbd_resources),
> +	.resource	= jornada_kbd_resources,
>  };
>  
>  static struct platform_device jornada_ts_device = {
> diff --git a/drivers/input/keyboard/jornada720_kbd.c b/drivers/input/keyboard/jornada720_kbd.c
> index 4b2e9ff18ba1..6ac9fee1d8fa 100644
> --- a/drivers/input/keyboard/jornada720_kbd.c
> +++ b/drivers/input/keyboard/jornada720_kbd.c
> @@ -26,7 +26,6 @@
>  
>  #include <mach/jornada720.h>
>  #include <mach/hardware.h>
> -#include <mach/irqs.h>
>  
>  MODULE_AUTHOR("Kristoffer Ericson <Kristoffer.Ericson@gmail.com>");
>  MODULE_DESCRIPTION("HP Jornada 710/720/728 keyboard driver");
> @@ -98,7 +97,11 @@ static int jornada720_kbd_probe(struct platform_device *pdev)
>  {
>  	struct jornadakbd *jornadakbd;
>  	struct input_dev *input_dev;
> -	int i, err;
> +	int i, err, irq;
> +
> +	irq = platform_get_irq(pdev, 0);
> +	if (irq <= 0)
> +		return irq < 0 ? irq : -EINVAL;
>  
>  	jornadakbd = devm_kzalloc(&pdev->dev, sizeof(*jornadakbd), GFP_KERNEL);
>  	input_dev = devm_input_allocate_device(&pdev->dev);
> @@ -126,10 +129,10 @@ static int jornada720_kbd_probe(struct platform_device *pdev)
>  
>  	input_set_capability(input_dev, EV_MSC, MSC_SCAN);
>  
> -	err = devm_request_irq(&pdev->dev, IRQ_GPIO0, jornada720_kbd_interrupt,
> +	err = devm_request_irq(&pdev->dev, irq, jornada720_kbd_interrupt,
>  			       IRQF_TRIGGER_FALLING, "jornadakbd", pdev);
>  	if (err) {
> -		printk(KERN_INFO "jornadakbd720_kbd: Unable to grab IRQ\n");
> +		dev_err(&pdev->dev, "unable to grab IRQ%d: %d\n", irq, err);
>  		return err;
>  	}
>  
> -- 
> 2.1.0
> 

-- 
Dmitry

WARNING: multiple messages have this Message-ID (diff)
From: dmitry.torokhov@gmail.com (Dmitry Torokhov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/4] Input: jornada720_kbd - get rid of mach/irqs.h include
Date: Wed, 7 Sep 2016 19:24:40 -0700	[thread overview]
Message-ID: <20160908022440.GF6445@dtor-ws> (raw)
In-Reply-To: <E1bhZVd-0005cZ-5z@rmk-PC.armlinux.org.uk>

On Wed, Sep 07, 2016 at 10:51:09AM +0100, Russell King wrote:
> Switch the jornada720 keyboard driver to obtain its interrupt from the
> platform device, rather than via a hard-coded interrupt number obtained
> from the mach/irqs.h header.
> 
> Tested-by: Adam Wysocki <armlinux@chmurka.net>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

This has already been applied as well.

> ---
>  arch/arm/mach-sa1100/jornada720.c       |  6 ++++++
>  drivers/input/keyboard/jornada720_kbd.c | 11 +++++++----
>  2 files changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c
> index c0b1f5bafae4..2b96f7bc16bd 100644
> --- a/arch/arm/mach-sa1100/jornada720.c
> +++ b/arch/arm/mach-sa1100/jornada720.c
> @@ -217,9 +217,15 @@ static struct platform_device jornada_ssp_device = {
>  	.id             = -1,
>  };
>  
> +static struct resource jornada_kbd_resources[] = {
> +	DEFINE_RES_IRQ(IRQ_GPIO0),
> +};
> +
>  static struct platform_device jornada_kbd_device = {
>  	.name		= "jornada720_kbd",
>  	.id		= -1,
> +	.num_resources	= ARRAY_SIZE(jornada_kbd_resources),
> +	.resource	= jornada_kbd_resources,
>  };
>  
>  static struct platform_device jornada_ts_device = {
> diff --git a/drivers/input/keyboard/jornada720_kbd.c b/drivers/input/keyboard/jornada720_kbd.c
> index 4b2e9ff18ba1..6ac9fee1d8fa 100644
> --- a/drivers/input/keyboard/jornada720_kbd.c
> +++ b/drivers/input/keyboard/jornada720_kbd.c
> @@ -26,7 +26,6 @@
>  
>  #include <mach/jornada720.h>
>  #include <mach/hardware.h>
> -#include <mach/irqs.h>
>  
>  MODULE_AUTHOR("Kristoffer Ericson <Kristoffer.Ericson@gmail.com>");
>  MODULE_DESCRIPTION("HP Jornada 710/720/728 keyboard driver");
> @@ -98,7 +97,11 @@ static int jornada720_kbd_probe(struct platform_device *pdev)
>  {
>  	struct jornadakbd *jornadakbd;
>  	struct input_dev *input_dev;
> -	int i, err;
> +	int i, err, irq;
> +
> +	irq = platform_get_irq(pdev, 0);
> +	if (irq <= 0)
> +		return irq < 0 ? irq : -EINVAL;
>  
>  	jornadakbd = devm_kzalloc(&pdev->dev, sizeof(*jornadakbd), GFP_KERNEL);
>  	input_dev = devm_input_allocate_device(&pdev->dev);
> @@ -126,10 +129,10 @@ static int jornada720_kbd_probe(struct platform_device *pdev)
>  
>  	input_set_capability(input_dev, EV_MSC, MSC_SCAN);
>  
> -	err = devm_request_irq(&pdev->dev, IRQ_GPIO0, jornada720_kbd_interrupt,
> +	err = devm_request_irq(&pdev->dev, irq, jornada720_kbd_interrupt,
>  			       IRQF_TRIGGER_FALLING, "jornadakbd", pdev);
>  	if (err) {
> -		printk(KERN_INFO "jornadakbd720_kbd: Unable to grab IRQ\n");
> +		dev_err(&pdev->dev, "unable to grab IRQ%d: %d\n", irq, err);
>  		return err;
>  	}
>  
> -- 
> 2.1.0
> 

-- 
Dmitry

  reply	other threads:[~2016-09-08  2:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-07  9:50 [PATCH 0/4] Input updates for Jornada720 Russell King - ARM Linux
2016-09-07  9:50 ` Russell King - ARM Linux
2016-09-07  9:51 ` [PATCH 1/4] Input: jornada720_kbd - switch to devm_* APIs Russell King
2016-09-08  2:24   ` Dmitry Torokhov
2016-09-07  9:51 ` [PATCH 2/4] Input: jornada720_kbd - get rid of mach/irqs.h include Russell King
2016-09-07  9:51   ` Russell King
2016-09-08  2:24   ` Dmitry Torokhov [this message]
2016-09-08  2:24     ` Dmitry Torokhov
2016-09-07  9:51 ` [PATCH 3/4] Input: jornada720_kbd - remove unneeded mach/hardware.h include Russell King
2016-09-08  2:21   ` Dmitry Torokhov
2016-09-07  9:51 ` [PATCH 4/4] Input: jornada720_ts - get rid of mach/irqs.h and mach/hardware.h includes Russell King
2016-09-07  9:51   ` Russell King
2016-09-08  2:22   ` Dmitry Torokhov
2016-09-08  2:22     ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160908022440.GF6445@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=kristoffer.ericson@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-input@vger.kernel.org \
    --cc=rmk+kernel@armlinux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.