From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Rob Herring <robh+dt@kernel.org>
Cc: linux-kernel@vger.kernel.org,
Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
Chen-Yu Tsai <wens@csie.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Samuel Holland <samuel@sholland.org>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Frank Rowand <frowand.list@gmail.com>, Liang He <windhl@126.com>,
Thomas Gleixner <tglx@linutronix.de>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Thomas Zimmermann <tzimmermann@suse.de>,
Douglas Anderson <dianders@chromium.org>,
Lyude Paul <lyude@redhat.com>,
Corentin Labbe <clabbe@baylibre.com>,
Zou Wei <zou_wei@huawei.com>,
linuxppc-dev@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev, dri-devel@lists.freedesktop.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH v2 01/16] of: device: make of_device_uevent_modalias() take a const device *
Date: Wed, 11 Jan 2023 17:30:53 +0200 [thread overview]
Message-ID: <88faa612-e7a0-24b8-aba8-4a42919402ec@linaro.org> (raw)
In-Reply-To: <Y77VDGvHGu8gDIga@kroah.com>
On 11/01/2023 17:26, Greg Kroah-Hartman wrote:
> On Wed, Jan 11, 2023 at 08:54:04AM -0600, Rob Herring wrote:
>> On Wed, Jan 11, 2023 at 5:30 AM Greg Kroah-Hartman
>> <gregkh@linuxfoundation.org> wrote:
>>>
>>> of_device_uevent_modalias() does not modify the device pointer passed to
>>> it, so mark it constant. In order to properly do this, a number of
>>> busses need to have a modalias function added as they were attempting to
>>> just point to of_device_uevent_modalias instead of their bus-specific
>>> modalias function. This is fine except if the prototype for a bus and
>>> device type modalias function diverges and then problems could happen. To
>>> prevent all of that, just wrap the call to of_device_uevent_modalias()
>>> directly for each bus and device type individually.
>>
>> Why not just put the wrapper function in the DT code instead of making
>> 4 copies of it?
>
> I could, if you think that it would be better there instead of in each
> individual bus (like all of the other bus callbacks). This way each bus
> "owns" their implementation :)
I'd vote for the generic wrapper instead of 4 similar wrapper. In the
end, if of_device_uevent_modalias (or the bus callback) interface
changes again for whatever reasons, there will be just a single place to
fix rather than fixing 4 (or more) bus drivers.
--
With best wishes
Dmitry
next prev parent reply other threads:[~2023-01-11 15:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230111113018.459199-1-gregkh@linuxfoundation.org>
2023-01-11 11:30 ` [PATCH v2 01/16] of: device: make of_device_uevent_modalias() take a const device * Greg Kroah-Hartman
2023-01-11 14:54 ` Rob Herring
2023-01-11 15:26 ` Greg Kroah-Hartman
2023-01-11 15:30 ` Dmitry Baryshkov [this message]
2023-01-27 12:33 ` Greg Kroah-Hartman
2023-01-11 11:30 ` [PATCH v2 05/16] driver core: make struct device_type.uevent() take a const * Greg Kroah-Hartman
2023-01-11 11:50 ` Wolfram Sang
2023-01-11 12:34 ` Vinod Koul
2023-01-11 13:32 ` Alexandre Belloni
2023-01-12 11:58 ` Heikki Krogerus
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=88faa612-e7a0-24b8-aba8-4a42919402ec@linaro.org \
--to=dmitry.baryshkov@linaro.org \
--cc=airlied@gmail.com \
--cc=benh@kernel.crashing.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=christophe.leroy@csgroup.eu \
--cc=clabbe@baylibre.com \
--cc=daniel@ffwll.ch \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=frowand.list@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jernej.skrabec@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=lyude@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=robh+dt@kernel.org \
--cc=samuel@sholland.org \
--cc=tglx@linutronix.de \
--cc=tzimmermann@suse.de \
--cc=wens@csie.org \
--cc=windhl@126.com \
--cc=zou_wei@huawei.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 NNTP newsgroup(s).