All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mattijs Korpershoek <mkorpershoek@baylibre.com>
To: AngeloGioacchino Del Regno 
	<angelogioacchino.delregno@collabora.com>,
	dmitry.torokhov@gmail.com
Cc: matthias.bgg@gmail.com, lv.ruyi@zte.com.cn,
	m.felsch@pengutronix.de, angelogioacchino.delregno@collabora.com,
	fengping.yu@mediatek.com, linux-input@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: mt6779-keypad: Move iomem pointer to probe function
Date: Wed, 06 Apr 2022 14:41:16 +0200	[thread overview]
Message-ID: <87czhu2xlf.fsf@baylibre.com> (raw)
In-Reply-To: <20220406115654.115093-1-angelogioacchino.delregno@collabora.com>

On mer., avril 06, 2022 at 13:56, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> wrote:

> The mmio base address is used for the only purpose of initializing
> regmap for this driver, hence it's not necessary to have it in the
> main driver structure, as it is used only in the probe() callback.
> Move it local to function mt6779_keypad_pdrv_probe().
>
> This commit brings no functional changes.
>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Thank you Angelo,

I planned to do this myself but I've been too slow :)

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>

> ---
>  drivers/input/keyboard/mt6779-keypad.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/input/keyboard/mt6779-keypad.c b/drivers/input/keyboard/mt6779-keypad.c
> index 0dbbddc7f298..2e7c9187c10f 100644
> --- a/drivers/input/keyboard/mt6779-keypad.c
> +++ b/drivers/input/keyboard/mt6779-keypad.c
> @@ -24,7 +24,6 @@ struct mt6779_keypad {
>  	struct regmap *regmap;
>  	struct input_dev *input_dev;
>  	struct clk *clk;
> -	void __iomem *base;
>  	u32 n_rows;
>  	u32 n_cols;
>  	DECLARE_BITMAP(keymap_state, MTK_KPD_NUM_BITS);
> @@ -91,6 +90,7 @@ static void mt6779_keypad_clk_disable(void *data)
>  static int mt6779_keypad_pdrv_probe(struct platform_device *pdev)
>  {
>  	struct mt6779_keypad *keypad;
> +	void __iomem *base;
>  	int irq;
>  	u32 debounce;
>  	bool wakeup;
> @@ -100,11 +100,11 @@ static int mt6779_keypad_pdrv_probe(struct platform_device *pdev)
>  	if (!keypad)
>  		return -ENOMEM;
>  
> -	keypad->base = devm_platform_ioremap_resource(pdev, 0);
> -	if (IS_ERR(keypad->base))
> -		return PTR_ERR(keypad->base);
> +	base = devm_platform_ioremap_resource(pdev, 0);
> +	if (IS_ERR(base))
> +		return PTR_ERR(base);
>  
> -	keypad->regmap = devm_regmap_init_mmio(&pdev->dev, keypad->base,
> +	keypad->regmap = devm_regmap_init_mmio(&pdev->dev, base,
>  					       &mt6779_keypad_regmap_cfg);
>  	if (IS_ERR(keypad->regmap)) {
>  		dev_err(&pdev->dev,
> -- 
> 2.35.1

WARNING: multiple messages have this Message-ID (diff)
From: Mattijs Korpershoek <mkorpershoek@baylibre.com>
To: AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	dmitry.torokhov@gmail.com
Cc: matthias.bgg@gmail.com, lv.ruyi@zte.com.cn,
	m.felsch@pengutronix.de, angelogioacchino.delregno@collabora.com,
	fengping.yu@mediatek.com, linux-input@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: mt6779-keypad: Move iomem pointer to probe function
Date: Wed, 06 Apr 2022 14:41:16 +0200	[thread overview]
Message-ID: <87czhu2xlf.fsf@baylibre.com> (raw)
In-Reply-To: <20220406115654.115093-1-angelogioacchino.delregno@collabora.com>

On mer., avril 06, 2022 at 13:56, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> wrote:

> The mmio base address is used for the only purpose of initializing
> regmap for this driver, hence it's not necessary to have it in the
> main driver structure, as it is used only in the probe() callback.
> Move it local to function mt6779_keypad_pdrv_probe().
>
> This commit brings no functional changes.
>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Thank you Angelo,

I planned to do this myself but I've been too slow :)

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>

> ---
>  drivers/input/keyboard/mt6779-keypad.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/input/keyboard/mt6779-keypad.c b/drivers/input/keyboard/mt6779-keypad.c
> index 0dbbddc7f298..2e7c9187c10f 100644
> --- a/drivers/input/keyboard/mt6779-keypad.c
> +++ b/drivers/input/keyboard/mt6779-keypad.c
> @@ -24,7 +24,6 @@ struct mt6779_keypad {
>  	struct regmap *regmap;
>  	struct input_dev *input_dev;
>  	struct clk *clk;
> -	void __iomem *base;
>  	u32 n_rows;
>  	u32 n_cols;
>  	DECLARE_BITMAP(keymap_state, MTK_KPD_NUM_BITS);
> @@ -91,6 +90,7 @@ static void mt6779_keypad_clk_disable(void *data)
>  static int mt6779_keypad_pdrv_probe(struct platform_device *pdev)
>  {
>  	struct mt6779_keypad *keypad;
> +	void __iomem *base;
>  	int irq;
>  	u32 debounce;
>  	bool wakeup;
> @@ -100,11 +100,11 @@ static int mt6779_keypad_pdrv_probe(struct platform_device *pdev)
>  	if (!keypad)
>  		return -ENOMEM;
>  
> -	keypad->base = devm_platform_ioremap_resource(pdev, 0);
> -	if (IS_ERR(keypad->base))
> -		return PTR_ERR(keypad->base);
> +	base = devm_platform_ioremap_resource(pdev, 0);
> +	if (IS_ERR(base))
> +		return PTR_ERR(base);
>  
> -	keypad->regmap = devm_regmap_init_mmio(&pdev->dev, keypad->base,
> +	keypad->regmap = devm_regmap_init_mmio(&pdev->dev, base,
>  					       &mt6779_keypad_regmap_cfg);
>  	if (IS_ERR(keypad->regmap)) {
>  		dev_err(&pdev->dev,
> -- 
> 2.35.1

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

WARNING: multiple messages have this Message-ID (diff)
From: Mattijs Korpershoek <mkorpershoek@baylibre.com>
To: AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	dmitry.torokhov@gmail.com
Cc: matthias.bgg@gmail.com, lv.ruyi@zte.com.cn,
	m.felsch@pengutronix.de, angelogioacchino.delregno@collabora.com,
	fengping.yu@mediatek.com, linux-input@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: mt6779-keypad: Move iomem pointer to probe function
Date: Wed, 06 Apr 2022 14:41:16 +0200	[thread overview]
Message-ID: <87czhu2xlf.fsf@baylibre.com> (raw)
In-Reply-To: <20220406115654.115093-1-angelogioacchino.delregno@collabora.com>

On mer., avril 06, 2022 at 13:56, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> wrote:

> The mmio base address is used for the only purpose of initializing
> regmap for this driver, hence it's not necessary to have it in the
> main driver structure, as it is used only in the probe() callback.
> Move it local to function mt6779_keypad_pdrv_probe().
>
> This commit brings no functional changes.
>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Thank you Angelo,

I planned to do this myself but I've been too slow :)

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>

> ---
>  drivers/input/keyboard/mt6779-keypad.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/input/keyboard/mt6779-keypad.c b/drivers/input/keyboard/mt6779-keypad.c
> index 0dbbddc7f298..2e7c9187c10f 100644
> --- a/drivers/input/keyboard/mt6779-keypad.c
> +++ b/drivers/input/keyboard/mt6779-keypad.c
> @@ -24,7 +24,6 @@ struct mt6779_keypad {
>  	struct regmap *regmap;
>  	struct input_dev *input_dev;
>  	struct clk *clk;
> -	void __iomem *base;
>  	u32 n_rows;
>  	u32 n_cols;
>  	DECLARE_BITMAP(keymap_state, MTK_KPD_NUM_BITS);
> @@ -91,6 +90,7 @@ static void mt6779_keypad_clk_disable(void *data)
>  static int mt6779_keypad_pdrv_probe(struct platform_device *pdev)
>  {
>  	struct mt6779_keypad *keypad;
> +	void __iomem *base;
>  	int irq;
>  	u32 debounce;
>  	bool wakeup;
> @@ -100,11 +100,11 @@ static int mt6779_keypad_pdrv_probe(struct platform_device *pdev)
>  	if (!keypad)
>  		return -ENOMEM;
>  
> -	keypad->base = devm_platform_ioremap_resource(pdev, 0);
> -	if (IS_ERR(keypad->base))
> -		return PTR_ERR(keypad->base);
> +	base = devm_platform_ioremap_resource(pdev, 0);
> +	if (IS_ERR(base))
> +		return PTR_ERR(base);
>  
> -	keypad->regmap = devm_regmap_init_mmio(&pdev->dev, keypad->base,
> +	keypad->regmap = devm_regmap_init_mmio(&pdev->dev, base,
>  					       &mt6779_keypad_regmap_cfg);
>  	if (IS_ERR(keypad->regmap)) {
>  		dev_err(&pdev->dev,
> -- 
> 2.35.1

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-04-06 15:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-06 11:56 [PATCH] Input: mt6779-keypad: Move iomem pointer to probe function AngeloGioacchino Del Regno
2022-04-06 11:56 ` AngeloGioacchino Del Regno
2022-04-06 11:56 ` AngeloGioacchino Del Regno
2022-04-06 12:41 ` Mattijs Korpershoek [this message]
2022-04-06 12:41   ` Mattijs Korpershoek
2022-04-06 12:41   ` Mattijs Korpershoek
2022-04-09  1:33 ` Dmitry Torokhov
2022-04-09  1:33   ` Dmitry Torokhov
2022-04-09  1:33   ` 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=87czhu2xlf.fsf@baylibre.com \
    --to=mkorpershoek@baylibre.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=fengping.yu@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=lv.ruyi@zte.com.cn \
    --cc=m.felsch@pengutronix.de \
    --cc=matthias.bgg@gmail.com \
    /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.