mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-08-15 06:33:45 +09:00
![Simon Glass](/assets/img/avatar_default.png)
The SCSI uclass currently has no operations. It just uses the global SCSI functions. Fix this by adding operations to the only two drivers that use the uclass, and replacing the global functions with those defined locally in the SCSI code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
41 lines
740 B
C
41 lines
740 B
C
/*
|
|
* Copyright (c) 2015 Google, Inc
|
|
* Written by Simon Glass <sjg@chromium.org>
|
|
* Copyright (c) 2016 Xilinx, Inc
|
|
* Written by Michal Simek
|
|
*
|
|
* Based on ahci-uclass.c
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <dm.h>
|
|
#include <scsi.h>
|
|
|
|
int scsi_exec(struct udevice *dev, struct scsi_cmd *pccb)
|
|
{
|
|
struct scsi_ops *ops = scsi_get_ops(dev);
|
|
|
|
if (!ops->exec)
|
|
return -ENOSYS;
|
|
|
|
return ops->exec(dev, pccb);
|
|
}
|
|
|
|
int scsi_bus_reset(struct udevice *dev)
|
|
{
|
|
struct scsi_ops *ops = scsi_get_ops(dev);
|
|
|
|
if (!ops->bus_reset)
|
|
return -ENOSYS;
|
|
|
|
return ops->bus_reset(dev);
|
|
}
|
|
|
|
UCLASS_DRIVER(scsi) = {
|
|
.id = UCLASS_SCSI,
|
|
.name = "scsi",
|
|
.per_device_platdata_auto_alloc_size = sizeof(struct scsi_platdata),
|
|
};
|