linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: mt6779-keypad: Move iomem pointer to probe function
@ 2022-04-06 11:56 AngeloGioacchino Del Regno
  2022-04-06 12:41 ` Mattijs Korpershoek
  2022-04-09  1:33 ` Dmitry Torokhov
  0 siblings, 2 replies; 3+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-04-06 11:56 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: matthias.bgg, mkorpershoek, lv.ruyi, m.felsch,
	angelogioacchino.delregno, fengping.yu, linux-input,
	linux-arm-kernel, linux-mediatek, linux-kernel

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>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Input: mt6779-keypad: Move iomem pointer to probe function
  2022-04-06 11:56 [PATCH] Input: mt6779-keypad: Move iomem pointer to probe function AngeloGioacchino Del Regno
@ 2022-04-06 12:41 ` Mattijs Korpershoek
  2022-04-09  1:33 ` Dmitry Torokhov
  1 sibling, 0 replies; 3+ messages in thread
From: Mattijs Korpershoek @ 2022-04-06 12:41 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, dmitry.torokhov
  Cc: matthias.bgg, lv.ruyi, m.felsch, angelogioacchino.delregno,
	fengping.yu, linux-input, linux-arm-kernel, linux-mediatek,
	linux-kernel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Input: mt6779-keypad: Move iomem pointer to probe function
  2022-04-06 11:56 [PATCH] Input: mt6779-keypad: Move iomem pointer to probe function AngeloGioacchino Del Regno
  2022-04-06 12:41 ` Mattijs Korpershoek
@ 2022-04-09  1:33 ` Dmitry Torokhov
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2022-04-09  1:33 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: matthias.bgg, mkorpershoek, lv.ruyi, m.felsch, fengping.yu,
	linux-input, linux-arm-kernel, linux-mediatek, linux-kernel

On Wed, Apr 06, 2022 at 01:56:54PM +0200, AngeloGioacchino Del Regno 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>

Applied, thank you.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-09  1:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-06 11:56 [PATCH] Input: mt6779-keypad: Move iomem pointer to probe function AngeloGioacchino Del Regno
2022-04-06 12:41 ` Mattijs Korpershoek
2022-04-09  1:33 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).