From: Tom Rini Date: Wed, 24 Feb 2016 11:20:38 -0500 Subject: [U-Boot] [U-Boot, v2, 3/7] drivers: block: disk-uclass: implement scsi_init() In-Reply-To: <1454500780-20751-4-git-send-email-mugunthanvnm@ti.com> References: <1454500780-20751-4-git-send-email-mugunthanvnm@ti.com> Message-ID: <20160224162038.GA7705@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, Feb 03, 2016 at 05:29:36PM +0530, Mugunthan V N wrote: > Implement scsi_init() api to probe driver model based sata > devices. > > Signed-off-by: Mugunthan V N > Reviewed-by: Simon Glass > --- > drivers/block/disk-uclass.c | 39 +++++++++++++++++++++++++++++++++++++++ > 1 file changed, 39 insertions(+) > > diff --git a/drivers/block/disk-uclass.c b/drivers/block/disk-uclass.c > index d665b35..4bd7b56 100644 > --- a/drivers/block/disk-uclass.c > +++ b/drivers/block/disk-uclass.c > @@ -7,6 +7,45 @@ > > #include > #include > +#include > +#include > +#include > + > +int scsi_get_device(int index, struct udevice **devp) > +{ > + struct udevice *dev; > + int ret; > + > + ret = uclass_find_device(UCLASS_DISK, index, &dev); > + if (ret || !dev) { > + printf("%d device not found\n", index); > + return ret; > + } > + > + ret = device_probe(dev); > + if (ret) { > + error("device probe error\n"); > + return ret; > + } > + > + *devp = dev; > + > + return ret; > +} > + > +void scsi_init(void) > +{ > + struct udevice *dev; > + int ret; > + > + ret = scsi_get_device(0, &dev); > + if (ret || !dev) { > + error("scsi device not found\n"); > + return; > + } > + > + scsi_scan(1); > +} > > UCLASS_DRIVER(disk) = { > .id = UCLASS_DISK, OK, this patch is a problem. Many platforms already define scsi_init() and aren't moved over so now fail to build. Mele_M5 is one of many examples here, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: