public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Danilo Krummrich <dakr@kernel.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: exporting a device type
Date: Fri, 11 Apr 2025 23:25:02 +0200	[thread overview]
Message-ID: <Z_mIrjA5k2CABoG_@pollux.localdomain> (raw)
In-Reply-To: <CAHp75VdssCM74oji59QjPMEzrVuBzPOAMadA=Ds_52hOZGJ2mw@mail.gmail.com>

On Fri, Apr 11, 2025 at 10:39:38PM +0300, Andy Shevchenko wrote:
> I have an issue with this change
> 
> https://web.git.kernel.org/pub/scm/linux/kernel/git/dakr/linux.git/commit/?h=for-driver-core&id=e86cc69186051d7312711565803de586efd9b2cf
> 
> (I think you haven't yet sent it for review, so this is just
> preliminary look at)
> 
> The idea of exporting bus type will open a non-reversible box of
> changes when people will start abusing it. Instead just provide an API
> dev_is_auxiliary() as it's done in other subsystems (yes, I know that
> some of them are still exporting the type, but it's most likely due to
> historical reasons of not thinking through it at that time).

Yeah, most busses export it and provide a dev_is_*() macro, which we can't use
in Rust. That's why for PCI and platform I started using the bus type directly,
see e.g. [1].

However, I already considered changing it up by just creating Rust helper
functions for the dev_is_*() macros and provide a dev_is_auxiliary() API
instead. This also simplifies things a bit and gets me rid of the
Device::bus_type_raw() helper.

[1] https://web.git.kernel.org/pub/scm/linux/kernel/git/dakr/linux.git/commit/?h=for-driver-core&id=d72c42c1da4149fec28e3b180654bf5fd88c2094

  reply	other threads:[~2025-04-11 21:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-11 19:39 exporting a device type Andy Shevchenko
2025-04-11 21:25 ` Danilo Krummrich [this message]
2025-04-12 17:56   ` Andy Shevchenko
2025-04-12 18:44     ` Danilo Krummrich

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=Z_mIrjA5k2CABoG_@pollux.localdomain \
    --to=dakr@kernel.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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