From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Rob Herring <robh+dt@kernel.org>
Cc: dri-devel@lists.freedesktop.org,
Douglas Anderson <dianders@chromium.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
David Airlie <airlied@gmail.com>, Liang He <windhl@126.com>,
Zou Wei <zou_wei@huawei.com>,
Samuel Holland <samuel@sholland.org>,
Frank Rowand <frowand.list@gmail.com>,
Chen-Yu Tsai <wens@csie.org>,
Corentin Labbe <clabbe@baylibre.com>,
linux-sunxi@lists.linux.dev, devicetree@vger.kernel.org,
Lyude Paul <lyude@redhat.com>, Daniel Vetter <daniel@ffwll.ch>,
Nicholas Piggin <npiggin@gmail.com>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Thomas Gleixner <tglx@linutronix.de>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Thomas Zimmermann <tzimmermann@suse.de>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2 01/16] of: device: make of_device_uevent_modalias() take a const device *
Date: Fri, 27 Jan 2023 13:33:56 +0100 [thread overview]
Message-ID: <Y9PEtP7oLjRJTxFM@kroah.com> (raw)
In-Reply-To: <CAL_JsqJ4QsLym-bQGGjUpzT14MYuTE1n8BQkGn6Ey9NiFF7u7w@mail.gmail.com>
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?
Ok, I looked at doing this today, but in the end, making "4" copies of
this is simpler overall. To do it your way would require a "const"
version of the function be added to the core, and then convert these 4
busses to use that, and then when the real function is converted to be
const, move all of these functions back over to use that again.
Lots of churn, and then in the end, we still have the mismatch of a
the same function callback being used in two different types of
callbacks (one a bus, one a class). This way we separate them to make
things much more obvious and self-contained.
So I'll keep this as-is for now, thanks.
greg k-h
next prev parent reply other threads:[~2023-01-27 12:35 UTC|newest]
Thread overview: 6+ 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
2023-01-27 12:33 ` Greg Kroah-Hartman [this message]
2023-01-11 11:30 ` [PATCH v2 08/16] vio: move to_vio_dev() to use container_of_const() Greg Kroah-Hartman
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=Y9PEtP7oLjRJTxFM@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=airlied@gmail.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=clabbe@baylibre.com \
--cc=daniel@ffwll.ch \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=frowand.list@gmail.com \
--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=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).