1 From: Hannes Reinecke <hare@suse.de>
2 Subject: Fixup return value in scsi_host_lookup()
5 scsi_host_lookup should always return an ERR_PTR() value if
6 it fails. This has changed in mainline where it returns a
7 NULL pointer on failure, but changing it now would be a
8 nasty kabi breakage. So stick with the established usage.
10 Signed-off-by: Hannes Reinecke <hare@suse.de>
12 --- linux-2.6.27-SLE11_BRANCH/drivers/scsi/hosts.c.orig 2008-10-10 00:13:53.000000000 +0200
13 +++ linux-2.6.27-SLE11_BRANCH/drivers/scsi/hosts.c 2009-02-05 11:23:43.910605056 +0100
14 @@ -464,7 +464,7 @@ static int __scsi_host_match(struct devi
15 struct Scsi_Host *scsi_host_lookup(unsigned short hostnum)
18 - struct Scsi_Host *shost = ERR_PTR(-ENXIO);
19 + struct Scsi_Host *shost = NULL;
21 cdev = class_find_device(&shost_class, NULL, &hostnum,
23 @@ -472,7 +472,7 @@ struct Scsi_Host *scsi_host_lookup(unsig
24 shost = scsi_host_get(class_to_shost(cdev));
28 + return shost ? shost : ERR_PTR(-ENXIO);
30 EXPORT_SYMBOL(scsi_host_lookup);