All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@steeleye.com>
To: Andries.Brouwer@cwi.nl
Cc: torvalds@transmeta.com, linux-kernel@vger.kernel.org,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH] scsi/hosts.c device_register fix
Date: Thu, 28 Nov 2002 10:57:40 -0600	[thread overview]
Message-ID: <200211281657.gASGve102802@localhost.localdomain> (raw)
In-Reply-To: Message from Andries.Brouwer@cwi.nl of "Thu, 28 Nov 2002 17:47:53 +0100." <UTC200211281647.gASGlrq03953.aeb@smtp.cwi.nl>

[-- Attachment #1: Type: text/plain, Size: 397 bytes --]

Actually, the patch is wrong.  It will wreak havoc with SCSI's use of sysfs.  
The device_register has to be done in scsi_add_host, which is called after all 
the driver specific sysfs setup has been done.  The correct fix is to move the 
corresponding device_unregister into scsi_remove_host so that they match.

I've attached it below.  I'll also commit it to the scsi-misc-2.5 BK tree.

James


[-- Attachment #2: tmp.diff --]
[-- Type: text/plain , Size: 396 bytes --]

===== hosts.c 1.31 vs edited =====
--- 1.31/drivers/scsi/hosts.c	Sun Nov 17 15:47:02 2002
+++ edited/hosts.c	Sat Nov 23 17:25:57 2002
@@ -295,6 +295,8 @@
 		kfree(sdev);
 	}
 
+	device_unregister(&shost->host_driverfs_dev);
+
 	return 0;
 }
 
@@ -348,7 +350,6 @@
 
 	/* Cleanup proc and driverfs */
 	scsi_proc_host_rm(shost);
-	device_unregister(&shost->host_driverfs_dev);
 
 	kfree(shost);
 }

  reply	other threads:[~2002-11-28 16:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-28 16:47 [PATCH] scsi/hosts.c device_register fix Andries.Brouwer
2002-11-28 16:57 ` James Bottomley [this message]
2002-11-28 22:53   ` Douglas Gilbert
  -- strict thread matches above, loose matches on Subject: below --
2002-11-28 17:18 Andries.Brouwer

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=200211281657.gASGve102802@localhost.localdomain \
    --to=james.bottomley@steeleye.com \
    --cc=Andries.Brouwer@cwi.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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.