mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: at91-sama5d2_adc: explain why indio_dev->name = dev_name() is wrong
Date: Sat, 27 Sep 2025 16:58:32 +0100	[thread overview]
Message-ID: <20250927165832.5ad37428@jic23-huawei> (raw)
In-Reply-To: <CAHp75VfkS_geLqSjMz95yb8smNqKTQTfyCA3KeeUGMSg1=EfOw@mail.gmail.com>

On Sun, 21 Sep 2025 21:33:02 +0300
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:

> On Sat, Sep 20, 2025 at 7:44 PM David Lechner <dlechner@baylibre.com> wrote:
> >
> > Add an explanatory comment on why indio_dev->name = dev_name(dev) is
> > wrong, and that we can't fix it without breaking userspace.
> >
> > The idea is to prevent future drivers from making the same mistake by
> > copying this code. And if this driver is ever modified again, we can
> > at least make sure any new compatible IDs use the correct name.  
> 
> ...
> 
> > +       /*
> > +        * The device name is supposed to be the "part number", not the kobject
> > +        * name. Do not copy this code for new drivers. We can't "fix" this
> > +        * without breaking userspace, so we have to live with it. However, if
> > +        * any new compatible IDs are added, please do something similar to
> > +        * adc/ltc2497-core.c so that at least the new part numbers are correct.  
> 
> Please, use the full path from the root of the source tree, i.e.
> drivers/iio/adc/ltc2497-core.c. IIRC the Sphynx might even render the
> links properly (if it ever goes to this deep comment, which is not
> marked as kernel-doc).

Other than that this looks like a good approach to me.
I was thinking maybe a reference to central doc, but that might be a bit fragile
so I think I prefer this approach of stating it fully at each place it matters.

Thanks,

Jonathan

> 
> > +        */
> >         indio_dev->name = dev_name(&pdev->dev);  
> 


      reply	other threads:[~2025-09-27 15:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-20 16:44 David Lechner
2025-09-21 18:33 ` Andy Shevchenko
2025-09-27 15:58   ` Jonathan Cameron [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=20250927165832.5ad37428@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.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

all inboxes | Powered by JetHome®