All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: linux-sh@vger.kernel.org, "Damien Le Moal" <dlemoal@kernel.org>,
	"Niklas Cassel" <cassel@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Michael Turquette" <mturquette@baylibre.com>,
	"Stephen Boyd" <sboyd@kernel.org>,
	"David Airlie" <airlied@gmail.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jiri Slaby" <jirislaby@kernel.org>,
	"Magnus Damm" <magnus.damm@gmail.com>,
	"Daniel Lezcano" <daniel.lezcano@linaro.org>,
	"Rich Felker" <dalias@libc.org>,
	"John Paul Adrian Glaubitz" <glaubitz@physik.fu-berlin.de>,
	"Lee Jones" <lee@kernel.org>, "Helge Deller" <deller@gmx.de>,
	"Heiko Stuebner" <heiko.stuebner@cherry.de>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Chris Morgan" <macromorgan@hotmail.com>,
	"Sebastian Reichel" <sre@kernel.org>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Masahiro Yamada" <masahiroy@kernel.org>,
	"Baoquan He" <bhe@redhat.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Guenter Roeck" <linux@roeck-us.net>,
	"Kefeng Wang" <wangkefeng.wang@huawei.com>,
	"Stephen Rothwell" <sfr@canb.auug.org.au>,
	"Azeem Shaikh" <azeemshaikh38@gmail.com>,
	"Guo Ren" <guoren@kernel.org>,
	"Max Filippov" <jcmvbkbc@gmail.com>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Herve Codina" <herve.codina@bootlin.com>,
	"Anup Patel" <apatel@ventanamicro.com>,
	"Jacky Huang" <ychuang3@nuvoton.com>,
	"Hugo Villeneuve" <hvilleneuve@dimonoff.com>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Wolfram Sang" <wsa+renesas@sang-engineering.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Christophe JAILLET" <christophe.jaillet@wanadoo.fr>,
	"Sam Ravnborg" <sam@ravnborg.org>,
	"Javier Martinez Canillas" <javierm@redhat.com>,
	"Sergey Shtylyov" <s.shtylyov@omp.ru>,
	"Laurent Pinchart" <laurent.pinchart+renesas@ideasonboard.com>,
	linux-ide@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-pci@vger.kernel.org, linux-serial@vger.kernel.org,
	linux-fbdev@vger.kernel.org
Subject: Re: [DO NOT MERGE v8 08/36] clocksource: sh_tmu: CLOCKSOURCE support.
Date: Wed, 29 May 2024 15:55:53 +0300	[thread overview]
Message-ID: <Zlcl2QxRDDrGh7Ru@smile.fi.intel.com> (raw)
In-Reply-To: <f40e91e3f010880b0cf7a1c3a18d0c57bb55d93a.1716965617.git.ysato@users.sourceforge.jp>

On Wed, May 29, 2024 at 05:00:54PM +0900, Yoshinori Sato wrote:
> Allows initialization as CLOCKSOURCE.

...

> -	dev_info(&ch->tmu->pdev->dev, "ch%u: used for %s clock events\n",
> -		 ch->index, periodic ? "periodic" : "oneshot");
> +	pr_info("%s ch%u: used for %s clock events\n",
> +		ch->tmu->name, ch->index, periodic ? "periodic" : "oneshot");

This is a step back change. We should use dev_*() if we have a device
available. And I believe this is the case (at least for the previous boards),
no?

...

> -	ch->irq = platform_get_irq(tmu->pdev, index);
> +	if (tmu->np)
> +		ch->irq = of_irq_get(tmu->np, index);
> +	else if (tmu->pdev)
> +		ch->irq = platform_get_irq(tmu->pdev, index);

I found these changes counterproductive. Instead better to have up to three
files to cover:
- the common code (library)
- the platform device support
- the pure OF support.

...

> -	res = platform_get_resource(tmu->pdev, IORESOURCE_MEM, 0);
> -	if (!res) {
> -		dev_err(&tmu->pdev->dev, "failed to get I/O memory\n");
> -		return -ENXIO;
> +	if (tmu->pdev) {
> +		res = platform_get_resource(tmu->pdev, IORESOURCE_MEM, 0);
> +		if (!res) {
> +			pr_err("sh_tmu failed to get I/O memory\n");
> +			return -ENXIO;
> +		}
> +
> +		tmu->mapbase = ioremap(res->start, resource_size(res));

devm_platform_ioremap_resource() should be good to have.
Again, consider proper splitting.

>  	}
> +	if (tmu->np)
> +		tmu->mapbase = of_iomap(tmu->np, 0);

So, how many boards are non-OF compatible? Maybe makes sense to move them to OF
and drop these platform code entirely from everywhere?

...

> +	tmu->name = dev_name(&pdev->dev);
> +	tmu->clk = clk_get(&tmu->pdev->dev, "fck");

devm_ approach can help a lot in case of platform device code.

> +	if (IS_ERR(tmu->clk)) {
> +		dev_err(&tmu->pdev->dev, "cannot get clock\n");
> +		return PTR_ERR(tmu->clk);

		return dev_err_probe() ?

> +	}

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2024-05-29 12:56 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-29  8:00 [DO NOT MERGE v8 00/36] Device Tree support for SH7751 based board Yoshinori Sato
2024-05-29  8:00 ` [DO NOT MERGE v8 01/36] sh: passing FDT address to kernel startup Yoshinori Sato
2024-05-29  8:00 ` [DO NOT MERGE v8 02/36] sh: Kconfig unified OF supported targets Yoshinori Sato
2024-05-29  8:00 ` [DO NOT MERGE v8 03/36] sh: Enable OF support for build and configuration Yoshinori Sato
2024-05-29  8:00 ` [DO NOT MERGE v8 04/36] dt-bindings: interrupt-controller: Add header for Renesas SH3/4 INTC Yoshinori Sato
2024-05-29  8:00 ` [DO NOT MERGE v8 05/36] sh: GENERIC_IRQ_CHIP support for CONFIG_OF=y Yoshinori Sato
2024-05-29  8:00 ` [DO NOT MERGE v8 06/36] sh: kernel/setup Update DT support Yoshinori Sato
2024-05-29  8:00 ` [DO NOT MERGE v8 07/36] sh: Fix COMMON_CLK support in CONFIG_OF=y Yoshinori Sato
2024-05-29  8:00 ` [DO NOT MERGE v8 08/36] clocksource: sh_tmu: CLOCKSOURCE support Yoshinori Sato
2024-05-29 12:55   ` Andy Shevchenko [this message]
2024-05-29  8:00 ` [DO NOT MERGE v8 09/36] dt-binding: Add compatible SH7750 SoC Yoshinori Sato
2024-05-29  8:00 ` [DO NOT MERGE v8 10/36] sh: Common PCI Framework driver support Yoshinori Sato
2024-05-29  8:00 ` [DO NOT MERGE v8 11/36] pci: pci-sh7751: Add SH7751 PCI driver Yoshinori Sato
2024-05-29  8:00 ` [DO NOT MERGE v8 12/36] dt-bindings: pci: pci-sh7751: Add SH7751 PCI Yoshinori Sato
2024-05-29  8:00 ` [DO NOT MERGE v8 13/36] dt-bindings: clock: sh7750-cpg: Add renesas,sh7750-cpg header Yoshinori Sato
2024-05-29  8:00   ` [DO NOT MERGE v8 13/36] dt-bindings: clock: sh7750-cpg: Add renesas, sh7750-cpg header Yoshinori Sato
2024-05-29 13:06   ` [DO NOT MERGE v8 13/36] dt-bindings: clock: sh7750-cpg: Add renesas,sh7750-cpg header Geert Uytterhoeven
2024-05-29  8:01 ` [DO NOT MERGE v8 14/36] clk: Compatible with narrow registers Yoshinori Sato
2024-05-29 23:15   ` Stephen Boyd
2024-05-29 23:15     ` Stephen Boyd
2024-05-29  8:01 ` [DO NOT MERGE v8 15/36] clk: renesas: Add SH7750/7751 CPG Driver Yoshinori Sato
2024-05-29  8:01 ` [DO NOT MERGE v8 16/36] irqchip: Add SH7751 INTC driver Yoshinori Sato
2024-05-29  8:01 ` [DO NOT MERGE v8 17/36] dt-bindings: interrupt-controller: renesas,sh7751-intc: Add json-schema Yoshinori Sato
2024-05-29  8:01   ` [DO NOT MERGE v8 17/36] dt-bindings: interrupt-controller: renesas, sh7751-intc: " Yoshinori Sato
2024-05-29  8:01 ` [DO NOT MERGE v8 18/36] irqchip: SH7751 external interrupt encoder with enable gate Yoshinori Sato
2024-05-29  8:01 ` [DO NOT MERGE v8 19/36] dt-bindings: interrupt-controller: renesas,sh7751-irl-ext: Add json-schema Yoshinori Sato
2024-05-29  8:01   ` [DO NOT MERGE v8 19/36] dt-bindings: interrupt-controller: renesas, sh7751-irl-ext: " Yoshinori Sato
2024-06-03 15:54   ` [DO NOT MERGE v8 19/36] dt-bindings: interrupt-controller: renesas,sh7751-irl-ext: " Rob Herring
2024-05-29  8:01 ` [DO NOT MERGE v8 20/36] serial: sh-sci: fix SH4 OF support Yoshinori Sato
2024-07-11 12:57   ` John Paul Adrian Glaubitz
2024-05-29  8:01 ` [DO NOT MERGE v8 21/36] dt-bindings: serial: renesas,scif: Add scif-sh7751 Yoshinori Sato
2024-05-29  8:01   ` [DO NOT MERGE v8 21/36] dt-bindings: serial: renesas, scif: " Yoshinori Sato
2024-06-03 15:55   ` [DO NOT MERGE v8 21/36] dt-bindings: serial: renesas,scif: " Rob Herring (Arm)
2024-05-29  8:01 ` [DO NOT MERGE v8 22/36] dt-bindings: display: smi,sm501: SMI SM501 binding json-schema Yoshinori Sato
2024-05-29  8:01   ` [DO NOT MERGE v8 22/36] dt-bindings: display: smi, sm501: " Yoshinori Sato
2024-05-29 10:44   ` [DO NOT MERGE v8 22/36] dt-bindings: display: smi,sm501: " Rob Herring (Arm)
2024-05-29  8:01 ` [DO NOT MERGE v8 23/36] mfd: sm501: Convert platform_data to OF property Yoshinori Sato
2024-05-31  9:56   ` Lee Jones
2024-05-29  8:01 ` [DO NOT MERGE v8 24/36] dt-binding: sh: cpus: Add SH CPUs json-schema Yoshinori Sato
2024-05-29 10:44   ` Rob Herring (Arm)
2024-05-29  8:01 ` [DO NOT MERGE v8 25/36] dt-bindings: vendor-prefixes: Add iodata Yoshinori Sato
2024-05-29 16:27   ` Conor Dooley
2024-05-29  8:01 ` [DO NOT MERGE v8 26/36] dt-bindings: ata: ata-generic: Add new targets Yoshinori Sato
2024-05-29 16:25   ` Conor Dooley
2024-05-29  8:01 ` [DO NOT MERGE v8 27/36] dt-bindings: soc: renesas: sh: Add SH7751 based target Yoshinori Sato
2024-05-29  8:01 ` [DO NOT MERGE v8 28/36] sh: SH7751R SoC Internal peripheral definition dtsi Yoshinori Sato
2024-05-29  8:01 ` [DO NOT MERGE v8 29/36] sh: add RTS7751R2D Plus DTS Yoshinori Sato
2024-05-29  8:01 ` [DO NOT MERGE v8 30/36] sh: Add IO DATA LANDISK dts Yoshinori Sato
2024-05-29  8:01 ` [DO NOT MERGE v8 31/36] sh: Add IO DATA USL-5P dts Yoshinori Sato
2024-05-29  8:01 ` [DO NOT MERGE v8 32/36] sh: j2_mimas_v2.dts update Yoshinori Sato
2024-05-29  8:01 ` [DO NOT MERGE v8 33/36] sh: Add dtbs target support Yoshinori Sato
2024-05-29  8:01 ` [DO NOT MERGE v8 34/36] sh: RTS7751R2D Plus OF defconfig Yoshinori Sato
2024-05-29  8:01 ` [DO NOT MERGE v8 35/36] sh: LANDISK " Yoshinori Sato
2024-05-29  8:01 ` [DO NOT MERGE v8 36/36] sh: j2_defconfig: update Yoshinori Sato
2024-05-30 17:15 ` [DO NOT MERGE v8 00/36] Device Tree support for SH7751 based board Bjorn Helgaas

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=Zlcl2QxRDDrGh7Ru@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=apatel@ventanamicro.com \
    --cc=arnd@arndb.de \
    --cc=azeemshaikh38@gmail.com \
    --cc=bhe@redhat.com \
    --cc=bhelgaas@google.com \
    --cc=cassel@kernel.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=dalias@libc.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=daniel@ffwll.ch \
    --cc=deller@gmx.de \
    --cc=devicetree@vger.kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=geert+renesas@glider.be \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=guoren@kernel.org \
    --cc=heiko.stuebner@cherry.de \
    --cc=herve.codina@bootlin.com \
    --cc=hvilleneuve@dimonoff.com \
    --cc=javierm@redhat.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jirislaby@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=kw@linux.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=lee@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=lpieralisi@kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=macromorgan@hotmail.com \
    --cc=magnus.damm@gmail.com \
    --cc=masahiroy@kernel.org \
    --cc=mripard@kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=neil.armstrong@linaro.org \
    --cc=robh@kernel.org \
    --cc=s.shtylyov@omp.ru \
    --cc=sam@ravnborg.org \
    --cc=sboyd@kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=sre@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tzimmermann@suse.de \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=wangkefeng.wang@huawei.com \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=ychuang3@nuvoton.com \
    --cc=ysato@users.sourceforge.jp \
    /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.