Linux-Clk Archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Marek Szyprowski <m.szyprowski@samsung.com>,
	William McVicker <willmcvicker@google.com>
Cc: linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Chanwoo Choi <cw00.choi@samsung.com>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
	David Lechner <david@lechnology.com>,
	Bjorn Andersson <andersson@kernel.org>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Subject: Re: [PATCH] clk: samsung: exynos-clkout: Remove misleading of_match_table/MODULE_DEVICE_TABLE
Date: Fri, 26 Apr 2024 11:26:14 +0200	[thread overview]
Message-ID: <6615daa1-6bb5-4da0-84b4-e84e7e0699c1@kernel.org> (raw)
In-Reply-To: <ad2cf931-0b51-4439-9963-bdb8a8b63b2b@samsung.com>

On 26/04/2024 11:21, Marek Szyprowski wrote:
> On 26.04.2024 11:02, Krzysztof Kozlowski wrote:
>> On 26/04/2024 07:24, Marek Szyprowski wrote:
>>> On 26.04.2024 02:24, William McVicker wrote:
>>>> On 04/25/2024, Marek Szyprowski wrote:
>>>>> Since commit 9484f2cb8332 ("clk: samsung: exynos-clkout: convert to
>>>>> module driver") this driver is instantiated as MFD-cell (matched by
>>>>> platform device name) not as a real platform device created by OF code.
>>>>> Remove then of_match_table and related MODULE_DEVICE_TABLE to avoid
>>>>> further confusion.
>>>>>
>>>>> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
>>>>> ---
>>>>>    drivers/clk/samsung/clk-exynos-clkout.c | 2 --
>>>>>    1 file changed, 2 deletions(-)
>>>>>
>>>>> diff --git a/drivers/clk/samsung/clk-exynos-clkout.c b/drivers/clk/samsung/clk-exynos-clkout.c
>>>>> index 503c6f5b20d5..0c7f4e2aa366 100644
>>>>> --- a/drivers/clk/samsung/clk-exynos-clkout.c
>>>>> +++ b/drivers/clk/samsung/clk-exynos-clkout.c
>>>>> @@ -75,7 +75,6 @@ static const struct of_device_id exynos_clkout_ids[] = {
>>>>>    		.data = &exynos_clkout_exynos5,
>>>>>    	}, { }
>>>>>    };
>>>>> -MODULE_DEVICE_TABLE(of, exynos_clkout_ids);
>>>> I understand these are duplicates of the exynos-pmu driver, but was wondering
>>>> if this will impact the exynos-clkout module from getting auto-loaded? Without
>>>> the MODULE_DEVICE_TABLE() defined, the aliases won't be created that trigger
>>>> udev to load this module and the mfd driver is obviously not going to load it.
>>> This driver loaded and matched only against the platform device name
>> Matched yes, but "loaded"? As in module loaded? Are you sure? There is
>> no MODULE_ALIAS, no platform_id_table with MODULE_DEVICE_TABLE, so with
>> this patch all aliases are gone.
>>
>> The old aliases indeed could have been used to load the clkout, even if
>> not used for matching.
> 
> Right, the proper solution is to add:
> 
> MODULE_ALIAS("platform:exynos-clkout");
> 
> I was convinced that the module_platform_driver() macro adds simple 
> module alias based on the driver name, but it looks that's not true. 
> Thanks for pointing this out. I will send v2 with the above alias then.

So just add simple platform ID table and MODULE_DEVICE_TABLE. It still
allows growing and in general is preferred than spreading aliases manually.

Best regards,
Krzysztof


      reply	other threads:[~2024-04-26  9:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20240425091434eucas1p11ec105de15d448c0fb14812705e4eac7@eucas1p1.samsung.com>
2024-04-25  9:14 ` [PATCH] clk: samsung: exynos-clkout: Remove misleading of_match_table/MODULE_DEVICE_TABLE Marek Szyprowski
2024-04-26  0:24   ` William McVicker
2024-04-26  5:24     ` Marek Szyprowski
2024-04-26  9:02       ` Krzysztof Kozlowski
2024-04-26  9:21         ` Marek Szyprowski
2024-04-26  9:26           ` Krzysztof Kozlowski [this message]

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=6615daa1-6bb5-4da0-84b4-e84e7e0699c1@kernel.org \
    --to=krzk@kernel.org \
    --cc=alim.akhtar@samsung.com \
    --cc=andersson@kernel.org \
    --cc=cw00.choi@samsung.com \
    --cc=david@lechnology.com \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mturquette@baylibre.com \
    --cc=robh@kernel.org \
    --cc=s.nawrocki@samsung.com \
    --cc=sboyd@kernel.org \
    --cc=willmcvicker@google.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 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 read-only IMAP folder(s) and NNTP newsgroup(s).