linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 07/10] ide: remove needless drive->present checks from device drivers
Date: Sat, 26 Jul 2008 15:40:51 +0200	[thread overview]
Message-ID: <20080726134051.10589.14729.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20080726134010.10589.51679.sendpatchset@localhost.localdomain>

Remove needless drive->present checks from ->probe methods
(device model takes care of that).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/ide-cd.c     |    4 ++--
 drivers/ide/ide-disk.c   |    3 +--
 drivers/ide/ide-floppy.c |    4 ++--
 drivers/ide/ide-tape.c   |    4 ++--
 drivers/scsi/ide-scsi.c  |    1 -
 5 files changed, 7 insertions(+), 9 deletions(-)

Index: b/drivers/ide/ide-cd.c
===================================================================
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -2105,10 +2105,10 @@ static int ide_cd_probe(ide_drive_t *dri
 
 	if (!strstr("ide-cdrom", drive->driver_req))
 		goto failed;
-	if (!drive->present)
-		goto failed;
+
 	if (drive->media != ide_cdrom && drive->media != ide_optical)
 		goto failed;
+
 	/* skip drives that we were told to ignore */
 	if (ignore != NULL) {
 		if (strstr(ignore, drive->name)) {
Index: b/drivers/ide/ide-disk.c
===================================================================
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -1143,8 +1143,7 @@ static int ide_disk_probe(ide_drive_t *d
 	/* strstr("foo", "") is non-NULL */
 	if (!strstr("ide-disk", drive->driver_req))
 		goto failed;
-	if (!drive->present)
-		goto failed;
+
 	if (drive->media != ide_disk)
 		goto failed;
 
Index: b/drivers/ide/ide-floppy.c
===================================================================
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -1389,10 +1389,10 @@ static int ide_floppy_probe(ide_drive_t 
 
 	if (!strstr("ide-floppy", drive->driver_req))
 		goto failed;
-	if (!drive->present)
-		goto failed;
+
 	if (drive->media != ide_floppy)
 		goto failed;
+
 	if (!idefloppy_identify_device(drive, drive->id)) {
 		printk(KERN_ERR "ide-floppy: %s: not supported by this version"
 				" of ide-floppy\n", drive->name);
Index: b/drivers/ide/ide-tape.c
===================================================================
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -2645,10 +2645,10 @@ static int ide_tape_probe(ide_drive_t *d
 
 	if (!strstr("ide-tape", drive->driver_req))
 		goto failed;
-	if (!drive->present)
-		goto failed;
+
 	if (drive->media != ide_tape)
 		goto failed;
+
 	if (!idetape_identify_device(drive)) {
 		printk(KERN_ERR "ide-tape: %s: not supported by this version of"
 				" the driver\n", drive->name);
Index: b/drivers/scsi/ide-scsi.c
===================================================================
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -821,7 +821,6 @@ static int ide_scsi_probe(ide_drive_t *d
 		return -ENODEV;
 
 	if (!strstr("ide-scsi", drive->driver_req) ||
-	    !drive->present ||
 	    drive->media == ide_disk ||
 	    !(host = scsi_host_alloc(&idescsi_template,sizeof(idescsi_scsi_t))))
 		return -ENODEV;

  parent reply	other threads:[~2008-07-26 13:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-26 13:40 [PATCH 01/10] ide: sanitize struct ide_port_ops documentation Bartlomiej Zolnierkiewicz
2008-07-26 13:40 ` [PATCH 02/10] ide: fix EXABYTENEST handling in probe_for_drive() Bartlomiej Zolnierkiewicz
2008-07-26 13:40 ` [PATCH 03/10] ide: enhance ide_busy_sleep() Bartlomiej Zolnierkiewicz
2008-07-26 13:40 ` [PATCH 04/10] ide: remove no longer needed BUG_ON()-s from init_irq() Bartlomiej Zolnierkiewicz
2008-07-26 13:40 ` [PATCH 05/10] ide: remove IDE_CHIPSET_* macros Bartlomiej Zolnierkiewicz
2008-07-26 13:40 ` [PATCH 06/10] ide: remove unused _IDE_C and _IDE_DISK defines Bartlomiej Zolnierkiewicz
2008-07-26 13:40 ` Bartlomiej Zolnierkiewicz [this message]
2008-07-26 13:40 ` [PATCH 08/10] ide: check drive->present in ide_get_paired_drive() Bartlomiej Zolnierkiewicz
2008-09-21  9:56   ` Sergei Shtylyov
2008-07-26 13:41 ` [PATCH 09/10] ide: use correct data phase for SMART READ DATA / LOG in ide_cmd_ioctl() Bartlomiej Zolnierkiewicz
2008-07-26 13:41 ` [PATCH 10/10] ide: remove CONFIG_IDEDISK_MULTI_MODE Bartlomiej Zolnierkiewicz
2008-07-26 16:18 ` [PATCH 01/10] ide: sanitize struct ide_port_ops documentation Randy Dunlap
2008-07-27 15:03   ` Bartlomiej Zolnierkiewicz

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=20080726134051.10589.14729.sendpatchset@localhost.localdomain \
    --to=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@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 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).