All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Adrian McMenamin <adrian@newgolddream.dyndns.info>
Cc: Paul Mundt <lethal@users.sourceforge.net>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-sh <linux-sh@vger.kernel.org>
Subject: Re: [PATCH 2/2] - SH/Dreamcast - fix maple bus bugs
Date: Wed, 06 Feb 2008 23:23:49 +0000	[thread overview]
Message-ID: <20080206232349.GA15654@kroah.com> (raw)
In-Reply-To: <1202339114.6162.17.camel@localhost.localdomain>

On Wed, Feb 06, 2008 at 11:05:14PM +0000, Adrian McMenamin wrote:
> 
> On Wed, 2008-02-06 at 15:01 -0800, Greg KH wrote:
> > On Wed, Feb 06, 2008 at 10:53:51PM +0000, Adrian McMenamin wrote:
> > > -	dev->function = function;
> > > -	dev->dev.bus = &maple_bus_type;
> > > -	dev->dev.parent = &maple_bus;
> > > -	dev->dev.release = &maple_release_device;
> > > -	retval = device_register(&dev->dev);
> > > -	if (retval) {
> > > -		printk(KERN_INFO
> > > -		       "Maple bus: Attempt to register device (%x, %x) failed.\n",
> > > -		       dev->port, dev->unit);
> > > -		maple_free_dev(dev);
> > > +	mdev->function = function;
> > > +	mdev->dev.release = &maple_release_device;
> > > +	if (mdev->registered = 0) {
> > > +		retval = device_register(&mdev->dev);
> > > +		if (retval) {
> > > +			printk(KERN_INFO
> > > +			"Maple bus: Attempt to register device"
> > > +			" (%x, %x) failed.\n",
> > > +			mdev->port, mdev->unit);
> > > +			maple_free_dev(mdev);
> > > +			mdev = NULL;
> > > +			return;
> > > +		}
> > > +		mdev->registered = 1;
> > >  	}
> > > -	dev->registered = 1;
> > 
> > I think you are still papering over the real problem here of trying to
> > register a device twice.  That's something you should never be doing,
> > and your bus walking logic must be incorrect...
> > 
> I just left that in as a sanity check. It should never be acted on. I
> can remove it if you prefer.

Please do, that way, and real problems will show up with that warning
you were getting that started all of this work :)

thanks,

greg k-h

WARNING: multiple messages have this Message-ID (diff)
From: Greg KH <greg@kroah.com>
To: Adrian McMenamin <adrian@newgolddream.dyndns.info>
Cc: Paul Mundt <lethal@users.sourceforge.net>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-sh <linux-sh@vger.kernel.org>
Subject: Re: [PATCH 2/2] - SH/Dreamcast - fix maple bus bugs
Date: Wed, 6 Feb 2008 15:23:49 -0800	[thread overview]
Message-ID: <20080206232349.GA15654@kroah.com> (raw)
In-Reply-To: <1202339114.6162.17.camel@localhost.localdomain>

On Wed, Feb 06, 2008 at 11:05:14PM +0000, Adrian McMenamin wrote:
> 
> On Wed, 2008-02-06 at 15:01 -0800, Greg KH wrote:
> > On Wed, Feb 06, 2008 at 10:53:51PM +0000, Adrian McMenamin wrote:
> > > -	dev->function = function;
> > > -	dev->dev.bus = &maple_bus_type;
> > > -	dev->dev.parent = &maple_bus;
> > > -	dev->dev.release = &maple_release_device;
> > > -	retval = device_register(&dev->dev);
> > > -	if (retval) {
> > > -		printk(KERN_INFO
> > > -		       "Maple bus: Attempt to register device (%x, %x) failed.\n",
> > > -		       dev->port, dev->unit);
> > > -		maple_free_dev(dev);
> > > +	mdev->function = function;
> > > +	mdev->dev.release = &maple_release_device;
> > > +	if (mdev->registered == 0) {
> > > +		retval = device_register(&mdev->dev);
> > > +		if (retval) {
> > > +			printk(KERN_INFO
> > > +			"Maple bus: Attempt to register device"
> > > +			" (%x, %x) failed.\n",
> > > +			mdev->port, mdev->unit);
> > > +			maple_free_dev(mdev);
> > > +			mdev = NULL;
> > > +			return;
> > > +		}
> > > +		mdev->registered = 1;
> > >  	}
> > > -	dev->registered = 1;
> > 
> > I think you are still papering over the real problem here of trying to
> > register a device twice.  That's something you should never be doing,
> > and your bus walking logic must be incorrect...
> > 
> I just left that in as a sanity check. It should never be acted on. I
> can remove it if you prefer.

Please do, that way, and real problems will show up with that warning
you were getting that started all of this work :)

thanks,

greg k-h

  reply	other threads:[~2008-02-06 23:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-06 22:46 [PATCH 1/2] - SH/Dreamcast - fix maple bus bugs Adrian McMenamin
2008-02-06 22:46 ` Adrian McMenamin
2008-02-06 22:53 ` [PATCH 2/2] " Adrian McMenamin
2008-02-06 22:53   ` Adrian McMenamin
2008-02-06 23:01   ` Greg KH
2008-02-06 23:01     ` Greg KH
2008-02-06 23:05     ` Adrian McMenamin
2008-02-06 23:05       ` Adrian McMenamin
2008-02-06 23:23       ` Greg KH [this message]
2008-02-06 23:23         ` Greg KH
2008-02-06 23:51         ` Adrian McMenamin
2008-02-06 23:51           ` Adrian McMenamin
2008-02-06 23:59           ` Greg KH
2008-02-06 23:59             ` Greg KH
2008-02-06 23:59         ` [PATCH] - SH/Dreamcast - additional patch to maple.h Adrian McMenamin
2008-02-07  2:35 ` [PATCH 1/2] - SH/Dreamcast - fix maple bus bugs Paul Mundt
2008-02-07  2:35   ` Paul Mundt

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=20080206232349.GA15654@kroah.com \
    --to=greg@kroah.com \
    --cc=adrian@newgolddream.dyndns.info \
    --cc=lethal@users.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@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 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.