All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Patrick Mochel <mochel@osdl.org>
Cc: Alexander Viro <viro@math.psu.edu>,
	linux-kernel@vger.kernel.org,
	linux-usb-devel@lists.sourceforge.net
Subject: Re: [RFC] device_initialize()
Date: Mon, 14 Oct 2002 11:03:25 -0700	[thread overview]
Message-ID: <20021014180325.GC7462@kroah.com> (raw)
In-Reply-To: <20021014172422.GE6955@kroah.com>

On Mon, Oct 14, 2002 at 10:24:22AM -0700, Greg KH wrote:
> +/**
>   * device_register - register a device
>   * @dev:	pointer to the device structure
>   *
> @@ -167,15 +188,10 @@
>  	if (!dev || !strlen(dev->bus_id))
>  		return -EINVAL;
>  
> -	INIT_LIST_HEAD(&dev->node);
> -	INIT_LIST_HEAD(&dev->children);
> -	INIT_LIST_HEAD(&dev->g_list);
> -	INIT_LIST_HEAD(&dev->driver_list);
> -	INIT_LIST_HEAD(&dev->bus_list);
> -	INIT_LIST_HEAD(&dev->intf_list);
> -	spin_lock_init(&dev->lock);
> -	atomic_set(&dev->refcount,2);
> -	dev->present = 1;
> +	if (dev->state != DEVICE_INITIALIZED)
> +		return -EINVAL;
> +
> +	get_device(dev);
>  	spin_lock(&device_lock);
>  	if (dev->parent) {
>  		get_device_locked(dev->parent);
> @@ -212,6 +228,7 @@
>  		if (dev->parent)
>  			put_device(dev->parent);
>  	}
> +	dev->state = DEVICE_INITIALIZED;


As someone just kindly pointed out to me, this should be
DEVICE_REGISTERED.  Sorry about that.

thanks,

greg k-h

  reply	other threads:[~2002-10-14 17:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-14 17:24 [RFC] device_initialize() Greg KH
2002-10-14 18:03 ` Greg KH [this message]
2002-10-15 17:58 ` Patrick Mochel
2002-10-15 18:08   ` Alexander Viro

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=20021014180325.GC7462@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=mochel@osdl.org \
    --cc=viro@math.psu.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.