LKML Archive on 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, 6 Feb 2008 15:01:27 -0800	[thread overview]
Message-ID: <20080206230127.GA9614@kroah.com> (raw)
In-Reply-To: <1202338431.6162.15.camel@localhost.localdomain>

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...

thanks,

greg k-h

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

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-06 22:46 [PATCH 1/2] " Adrian McMenamin
2008-02-06 22:53 ` [PATCH 2/2] " Adrian McMenamin
2008-02-06 23:01   ` Greg KH [this message]
2008-02-06 23:05     ` Adrian McMenamin
2008-02-06 23:23       ` Greg KH
2008-02-06 23:51         ` Adrian McMenamin
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

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=20080206230127.GA9614@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 \
    --subject='Re: [PATCH 2/2] - SH/Dreamcast - fix maple bus bugs' \
    /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

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).