Re: [U-Boot] [PATCH v2 07/10] scsi: make the LUN a parameter of scsi_detect_dev()

2017-04-15 Thread Simon Glass
On 9 April 2017 at 13:27, Simon Glass  wrote:
> On 7 April 2017 at 05:42, Jean-Jacques Hiblot  wrote:
>> This is a cosmetic change. target and LUN have kind of the same role in
>> this function. One of them was passed as a parameter and the other was
>> embedded in a structure. For consistency, pass both of them as parameters.
>>
>> Signed-off-by: Jean-Jacques Hiblot 
>> ---
>>  common/scsi.c | 14 +++---
>>  1 file changed, 7 insertions(+), 7 deletions(-)
>>
>
> Reviewed-by: Simon Glass 

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 07/10] scsi: make the LUN a parameter of scsi_detect_dev()

2017-04-09 Thread Simon Glass
On 7 April 2017 at 05:42, Jean-Jacques Hiblot  wrote:
> This is a cosmetic change. target and LUN have kind of the same role in
> this function. One of them was passed as a parameter and the other was
> embedded in a structure. For consistency, pass both of them as parameters.
>
> Signed-off-by: Jean-Jacques Hiblot 
> ---
>  common/scsi.c | 14 +++---
>  1 file changed, 7 insertions(+), 7 deletions(-)
>

Reviewed-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 07/10] scsi: make the LUN a parameter of scsi_detect_dev()

2017-04-08 Thread Tom Rini
On Fri, Apr 07, 2017 at 01:42:06PM +0200, Jean-Jacques Hiblot wrote:

> This is a cosmetic change. target and LUN have kind of the same role in
> this function. One of them was passed as a parameter and the other was
> embedded in a structure. For consistency, pass both of them as parameters.
> 
> Signed-off-by: Jean-Jacques Hiblot 

Reviewed-by: Tom Rini 

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 07/10] scsi: make the LUN a parameter of scsi_detect_dev()

2017-04-07 Thread Jean-Jacques Hiblot
This is a cosmetic change. target and LUN have kind of the same role in
this function. One of them was passed as a parameter and the other was
embedded in a structure. For consistency, pass both of them as parameters.

Signed-off-by: Jean-Jacques Hiblot 
---
 common/scsi.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/common/scsi.c b/common/scsi.c
index fb5b407..d55ba89 100644
--- a/common/scsi.c
+++ b/common/scsi.c
@@ -473,14 +473,15 @@ static void scsi_init_dev_desc(struct blk_desc *dev_desc, 
int devnum)
  * scsi_detect_dev - Detect scsi device
  *
  * @target: target id
+ * @lun: target lun
  * @dev_desc: block device description
  *
  * The scsi_detect_dev detects and fills a dev_desc structure when the device 
is
- * detected. The LUN number is taken from the struct blk_desc *dev_desc.
+ * detected.
  *
  * Return: 0 on success, error value otherwise
  */
-static int scsi_detect_dev(int target, struct blk_desc *dev_desc)
+static int scsi_detect_dev(int target, int lun, struct blk_desc *dev_desc)
 {
unsigned char perq, modi;
lbaint_t capacity;
@@ -488,7 +489,7 @@ static int scsi_detect_dev(int target, struct blk_desc 
*dev_desc)
ccb *pccb = (ccb *)
 
pccb->target = target;
-   pccb->lun = dev_desc->lun;
+   pccb->lun = lun;
pccb->pdata = (unsigned char *)
pccb->datalen = 512;
scsi_setup_inquiry(pccb);
@@ -599,8 +600,7 @@ int scsi_scan(int mode)
bdesc = dev_get_uclass_platdata(bdev);
 
scsi_init_dev_desc_priv(bdesc);
-   bdesc->lun = lun;
-   ret = scsi_detect_dev(i, bdesc);
+   ret = scsi_detect_dev(i, lun, bdesc);
if (ret) {
device_unbind(bdev);
continue;
@@ -630,8 +630,8 @@ int scsi_scan(int mode)
scsi_max_devs = 0;
for (i = 0; i < CONFIG_SYS_SCSI_MAX_SCSI_ID; i++) {
for (lun = 0; lun < CONFIG_SYS_SCSI_MAX_LUN; lun++) {
-   scsi_dev_desc[scsi_max_devs].lun = lun;
-   ret = scsi_detect_dev(i, _dev_desc[scsi_max_devs]);
+   ret = scsi_detect_dev(i, lun,
+ _dev_desc[scsi_max_devs]);
if (ret)
continue;
 
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot