Re: [PATCH v4 4/7] scsi: ufs: Add ufs-bsg module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> @@ -5,6 +5,9 @@ obj-$(CONFIG_SCSI_UFS_DWC_TC_PLATFORM) += tc-dwc-g210-pltfrm.o ufshcd-dwc.o tc-d
>  obj-$(CONFIG_SCSI_UFS_QCOM) += ufs-qcom.o
>  obj-$(CONFIG_SCSI_UFSHCD) += ufshcd-core.o
>  ufshcd-core-objs := ufshcd.o ufs-sysfs.o
> +ifeq ($(CONFIG_SCSI_UFS_BSG),y)
> +ufshcd-core-objs += ufs_bsg.o
> +endif

This shoukd be:

ufshcd-core-y				+= ufshcd.o ufs-sysfs.o
ufshcd-core-$(CONFIG_SCSI_UFS_BSG)	+= ufs_bsg.o

> +#include "ufs_bsg.h"
> +
> +struct ufs_bsg_node {
> +	struct device		dev;
> +	struct request_queue	*q;
> +};

I think I'd rather see the fields directly in struct ufs_hba as

	struct device		bsg_dev;
	struct request_queue	*bsg_queue;

> +static int ufs_bsg_request(struct bsg_job *job)
> +{
> +	struct ufs_bsg_request *bsg_request = job->request;
> +	struct ufs_bsg_reply *bsg_reply = job->reply;
> +	int ret = -ENOTSUPP;
> +
> +	bsg_reply->reply_payload_rcv_len = 0;
> +
> +	/* Do Nothing for now */
> +	dev_err(job->dev, "unsupported message_code 0x%x\n",
> +		bsg_request->msgcode);
> +
> +	bsg_reply->result = ret;
> +	if (ret)
> +		job->reply_len = sizeof(uint32_t);
> +	else
> +		job->reply_len = sizeof(struct ufs_bsg_reply) +
> +				 bsg_reply->reply_payload_rcv_len;
> +
> +	bsg_job_done(job, bsg_reply->result, bsg_reply->reply_payload_rcv_len);
> +
> +	return ret;

Do we really need to store the Linux return valu in the reply field?
Having only one length and format would seem a lot more intuitive to me.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux