All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@oss.nxp.com>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: Linus Walleij <linusw@kernel.org>,
	Bartosz Golaszewski <brgl@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Stefan Agner <stefan@agner.ch>,
	Dong Aisheng <aisheng.dong@nxp.com>, Jacky Bai <ping.bai@nxp.com>,
	Frank Li <Frank.Li@nxp.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org, Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH 06/11] gpio: vf610: drop unnecessary wrappers
Date: Thu, 29 Oct 2026 09:53:13 -0500	[thread overview]
Message-ID: <auNd2TJQmCDzi9i1@SMW015318> (raw)
In-Reply-To: <20261029-gpio-vf610-fixes-v1-6-45b484b4c434@nxp.com>

On Thu, Oct 29, 2026 at 09:42:30PM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> Remove trivial wrapper functions vf610_gpio_writel() and
> vf610_gpio_readl() that just called the relaxed versions directly.
> Replace their usage with direct calls to writel_relaxed() and
> readl_relaxed().
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---

Some time use simple wrapers is for adding debug message for each
register read and write when debugs.

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  drivers/gpio/gpio-vf610.c | 26 ++++++++------------------
>  1 file changed, 8 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c
> index 4c46342bc66c..f6712bb45841 100644
> --- a/drivers/gpio/gpio-vf610.c
> +++ b/drivers/gpio/gpio-vf610.c
> @@ -82,16 +82,6 @@ static const struct of_device_id vf610_gpio_dt_ids[] = {
>  };
>  MODULE_DEVICE_TABLE(of, vf610_gpio_dt_ids);
>
> -static inline void vf610_gpio_writel(u32 val, void __iomem *reg)
> -{
> -	writel_relaxed(val, reg);
> -}
> -
> -static inline u32 vf610_gpio_readl(void __iomem *reg)
> -{
> -	return readl_relaxed(reg);
> -}
> -
>  static void vf610_gpio_irq_handler(struct irq_desc *desc)
>  {
>  	struct vf610_gpio_port *port =
> @@ -102,10 +92,10 @@ static void vf610_gpio_irq_handler(struct irq_desc *desc)
>
>  	chained_irq_enter(chip, desc);
>
> -	irq_isfr = vf610_gpio_readl(port->base + PORT_ISFR);
> +	irq_isfr = readl_relaxed(port->base + PORT_ISFR);
>
>  	for_each_set_bit(pin, &irq_isfr, VF610_GPIO_PER_PORT) {
> -		vf610_gpio_writel(BIT(pin), port->base + PORT_ISFR);
> +		writel_relaxed(BIT(pin), port->base + PORT_ISFR);
>
>  		generic_handle_domain_irq(port->chip.gc.irq.domain, pin);
>  	}
> @@ -119,7 +109,7 @@ static void vf610_gpio_irq_ack(struct irq_data *d)
>  		gpiochip_get_data(irq_data_get_irq_chip_data(d));
>  	int gpio = d->hwirq;
>
> -	vf610_gpio_writel(BIT(gpio), port->base + PORT_ISFR);
> +	writel_relaxed(BIT(gpio), port->base + PORT_ISFR);
>  }
>
>  static int vf610_gpio_irq_set_type(struct irq_data *d, u32 type)
> @@ -165,7 +155,7 @@ static void vf610_gpio_irq_mask(struct irq_data *d)
>  	irq_hw_number_t gpio_num = irqd_to_hwirq(d);
>  	void __iomem *pcr_base = port->base + PORT_PCR(gpio_num);
>
> -	vf610_gpio_writel(0, pcr_base);
> +	writel_relaxed(0, pcr_base);
>  	gpiochip_disable_irq(gc, gpio_num);
>  }
>
> @@ -177,8 +167,8 @@ static void vf610_gpio_irq_unmask(struct irq_data *d)
>  	void __iomem *pcr_base = port->base + PORT_PCR(gpio_num);
>
>  	gpiochip_enable_irq(gc, gpio_num);
> -	vf610_gpio_writel(port->irqc[gpio_num] << PORT_PCR_IRQC_OFFSET,
> -			  pcr_base);
> +	writel_relaxed(port->irqc[gpio_num] << PORT_PCR_IRQC_OFFSET,
> +		       pcr_base);
>  }
>
>  static int vf610_gpio_irq_set_wake(struct irq_data *d, u32 enable)
> @@ -290,10 +280,10 @@ static int vf610_gpio_probe(struct platform_device *pdev)
>
>  	/* Mask all GPIO interrupts */
>  	for (i = 0; i < gc->ngpio; i++)
> -		vf610_gpio_writel(0, port->base + PORT_PCR(i));
> +		writel_relaxed(0, port->base + PORT_PCR(i));
>
>  	/* Clear the interrupt status register for all GPIO's */
> -	vf610_gpio_writel(~0, port->base + PORT_ISFR);
> +	writel_relaxed(~0, port->base + PORT_ISFR);
>
>  	girq = &gc->irq;
>  	gpio_irq_chip_set_chip(girq, &vf610_irqchip);
>
> --
> 2.51.0
>
>

  parent reply	other threads:[~2026-10-29 14:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29 13:42 [PATCH 00/11] gpio: vf610: fix clocks and misc cleanup Peng Fan (OSS)
2026-10-29 13:42 ` [PATCH 01/11] dt-bindings: gpio: vf610: fix clock requirements per SoC Peng Fan (OSS)
2026-10-29 14:30   ` Frank Li
2026-10-29 13:42 ` [PATCH 02/11] gpio: vf610: propagate return value to callers Peng Fan (OSS)
2026-10-29 13:57   ` sashiko-bot
2026-10-29 13:42 ` [PATCH 03/11] gpio: vf610: simplify with irq_set_irq_wake Peng Fan (OSS)
2026-10-29 14:46   ` Daniel Baluta
2026-10-29 14:46   ` Frank Li
2026-10-29 13:42 ` [PATCH 04/11] gpio: vf610: use devm_clk_get_optional_enabled for clock handling Peng Fan (OSS)
2026-10-29 14:50   ` Frank Li
2026-10-29 13:42 ` [PATCH 05/11] gpio: vf610: drop unneeded header Peng Fan (OSS)
2026-10-29 14:51   ` Frank Li
2026-10-29 13:42 ` [PATCH 06/11] gpio: vf610: drop unnecessary wrappers Peng Fan (OSS)
2026-10-29 14:45   ` Daniel Baluta
2026-10-29 14:53   ` Frank Li [this message]
2026-10-29 13:42 ` [PATCH 07/11] arm64: dts: imx8ulp: fix gpio clocks Peng Fan (OSS)
2026-10-29 13:42 ` [PATCH 08/11] arm64: dts: imx93: " Peng Fan (OSS)
2026-10-29 13:42 ` [PATCH 09/11] arm64: dts: imx95: " Peng Fan (OSS)
2026-10-29 13:42 ` [PATCH 10/11] arm64: dts: imx952: " Peng Fan (OSS)
2026-10-29 13:42 ` [PATCH 11/11] arm64: dts: imx94: add clocks for gpio controller Peng Fan (OSS)

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=auNd2TJQmCDzi9i1@SMW015318 \
    --to=frank.li@oss.nxp.com \
    --cc=Frank.Li@nxp.com \
    --cc=aisheng.dong@nxp.com \
    --cc=brgl@bgdev.pl \
    --cc=brgl@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=krzk+dt@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=ping.bai@nxp.com \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=stefan@agner.ch \
    /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.