From: Brian Gerst <bgerst@didntduck.org>
To: Patrick Mochel <mochel@osdl.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Problem with new driver model?
Date: Wed, 05 Jun 2002 17:00:44 -0400 [thread overview]
Message-ID: <3CFE7BFC.8EE5605@didntduck.org> (raw)
In-Reply-To: <Pine.LNX.4.33.0206051336170.654-100000@geena.pdx.osdl.net>
Patrick Mochel wrote:
>
> On 5 Jun 2002, Paul Fulghum wrote:
>
> > When testing the drivers I maintain on 2.5.20, I hit the
> > BUG_ON in include/linux/devices.txt:115.
>
> There is a patch that should fix this in Linus's tree.
>
> If you're using bitkeeper, you can pull it from
> linux.bkbits.net/linux-2.5.
>
> If not, it's appended here.
>
> -pat
>
> +void remove_driver(struct device_driver * drv)
> +{
> + spin_lock(&device_lock);
> + atomic_set(&drv->refcount,0);
> + spin_unlock(&device_lock);
> + __remove_driver(drv);
> +}
> +
> +/**
> + * put_driver - decrement driver's refcount and clean up if necessary
> + * @drv: driver in question
> + */
> +void put_driver(struct device_driver * drv)
> +{
> + if (!atomic_dec_and_lock(&drv->refcount,&device_lock))
> + return;
> + spin_unlock(&device_lock);
> +
> + __remove_driver(drv);
> +}
Shouldn't the calls to __remove_driver be done inside the device_lock?
--
Brian Gerst
next prev parent reply other threads:[~2002-06-05 21:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-05 20:25 Problem with new driver model? Paul Fulghum
2002-06-05 20:41 ` Greg KH
2002-06-05 20:43 ` Patrick Mochel
2002-06-05 21:00 ` Brian Gerst [this message]
2002-06-05 21:04 ` Patrick Mochel
2002-06-05 21:20 ` Paul Fulghum
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=3CFE7BFC.8EE5605@didntduck.org \
--to=bgerst@didntduck.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mochel@osdl.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