linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Shashank Balaji <shashank.mahadasyam@sony.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Bastien Nocera <hadess@hadess.net>,
	Matthias Kaehlcke <mka@chromium.org>,
	Valentina Manea <valentina.manea.m@gmail.com>,
	Shuah Khan <shuah@kernel.org>, Hongren Zheng <i@zenithal.me>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	linux-usb@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Daniel Palmer <daniel.palmer@sony.com>,
	Rahul Bukte <rahul.bukte@sony.com>, Tim Bird <tim.bird@sony.com>,
	linux-embedded@vger.kernel.org
Subject: Re: [PATCH 2/4] usb: core: set mod_name in driver registration
Date: Thu, 10 Sep 2026 14:42:44 +0200	[thread overview]
Message-ID: <2026091010-awkward-crouton-31e0@gregkh> (raw)
In-Reply-To: <20260722-mod_name_usb-v1-2-96d781530f3f@sony.com>

On Wed, Jul 22, 2026 at 12:31:22PM +0900, Shashank Balaji wrote:
> The driver core only creates the sysfs "module" symlink for a built-in
> driver when its struct device_driver has mod_name set (see
> module_add_driver()). This registration path left mod_name unset, so built-in
> drivers using it had no such symlink.
> 
> Set mod_name to KBUILD_MODNAME during driver registration. Built-in
> drivers now gain the symlink, while loadable modules are unaffected.
> 
> Co-developed-by: Rahul Bukte <rahul.bukte@sony.com>
> Signed-off-by: Rahul Bukte <rahul.bukte@sony.com>
> Signed-off-by: Shashank Balaji <shashank.mahadasyam@sony.com>
> ---
>  include/linux/usb.h       | 4 ++--
>  drivers/usb/core/driver.c | 4 +++-
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/include/linux/usb.h b/include/linux/usb.h
> index 2466183a45f0..6507c217bca7 100644
> --- a/include/linux/usb.h
> +++ b/include/linux/usb.h
> @@ -1369,9 +1369,9 @@ extern void usb_deregister(struct usb_driver *);
>  		       usb_deregister)
>  
>  #define usb_register_device_driver(new_udriver) \
> -	__usb_register_device_driver(new_udriver, THIS_MODULE)
> +	__usb_register_device_driver(new_udriver, THIS_MODULE, KBUILD_MODNAME)

It seems odd to me that struct module doesn't contain the name of the
module, and you have to pass this around all the time...

Anyway, all now queued up, thanks!

greg k-h

  reply	other threads:[~2026-09-10 12:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22  3:31 [PATCH 0/4] usb: enable sysfs module symlink for more built-in drivers Shashank Balaji
2026-07-22  3:31 ` [PATCH 1/4] usb: core: pass THIS_MODULE implicitly through a macro Shashank Balaji
2026-07-27 12:19   ` Bastien Nocera
2026-07-22  3:31 ` [PATCH 2/4] usb: core: set mod_name in driver registration Shashank Balaji
2026-09-10 12:42   ` Greg Kroah-Hartman [this message]
2026-07-22  3:31 ` [PATCH 3/4] usb: typec: " Shashank Balaji
2026-07-27 11:39   ` Heikki Krogerus
2026-07-22  3:31 ` [PATCH 4/4] usb: ulpi: " Shashank Balaji
2026-07-23 23:07 ` [PATCH 0/4] usb: enable sysfs module symlink for more built-in drivers Bird, Tim
2026-07-27 12:21 ` Bastien Nocera

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=2026091010-awkward-crouton-31e0@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=daniel.palmer@sony.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hadess@hadess.net \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=i@zenithal.me \
    --cc=kuba@kernel.org \
    --cc=linux-embedded@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mka@chromium.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rahul.bukte@sony.com \
    --cc=shashank.mahadasyam@sony.com \
    --cc=shuah@kernel.org \
    --cc=tim.bird@sony.com \
    --cc=valentina.manea.m@gmail.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).