ksummit.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Dan Williams <dan.j.williams@intel.com>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	ksummit <ksummit-discuss@lists.linuxfoundation.org>,
	ksummit@lists.linux.dev
Subject: Re: [TECH TOPIC] Driver probe fails and register succeeds
Date: Fri, 24 Jun 2022 08:33:09 +0200	[thread overview]
Message-ID: <YrVapQUhg4PVEw39@kroah.com> (raw)
In-Reply-To: <YrUMlki+cJkJ3R/X@google.com>

On Thu, Jun 23, 2022 at 06:00:06PM -0700, Dmitry Torokhov wrote:
> Nor does this work for drivers for devices that might be hot-plugged,
> instantiated via sysfs/new_id, etc, etc.

Agreed.

> So if you want to fail driver registration because you know that you are
> dealing with a singleton platform device with no additional dependencies
> then it has to be done in the driver itself, not by the driver core.

And even then, it really should not be done in the driver, that is not
how Linux drivers should work at all.  That's why we have macros to make
it so that module_init() just calls [SUBSYSTEM]_register() for the
subsystem in question, and the module is not supposed to do anything
else.

thanks,

greg k-h

  reply	other threads:[~2022-06-24  6:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-23 23:05 [TECH TOPIC] Driver probe fails and register succeeds Shuah Khan
2022-06-23 23:13 ` Laurent Pinchart
2022-06-23 23:28   ` Shuah Khan
2022-06-23 23:30     ` Laurent Pinchart
2022-06-23 23:38       ` Shuah Khan
2022-06-23 23:57         ` Dan Williams
2022-06-24  1:00           ` Dmitry Torokhov
2022-06-24  6:33             ` Greg KH [this message]
2022-06-23 23:24 ` Guenter Roeck
2022-06-24  6:31 ` Greg KH
2022-06-24 15:55   ` Shuah Khan

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=YrVapQUhg4PVEw39@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=dan.j.williams@intel.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=ksummit-discuss@lists.linuxfoundation.org \
    --cc=ksummit@lists.linux.dev \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=skhan@linuxfoundation.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;
as well as URLs for NNTP newsgroup(s).