All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Jacques Hiblot <jjhiblot@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 07/10] scsi: make the LUN a parameter of scsi_detect_dev()
Date: Fri, 7 Apr 2017 13:42:06 +0200	[thread overview]
Message-ID: <1491565329-20267-8-git-send-email-jjhiblot@ti.com> (raw)
In-Reply-To: <1491565329-20267-1-git-send-email-jjhiblot@ti.com>

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 <jjhiblot@ti.com>
---
 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 *)&tempccb;
 
 	pccb->target = target;
-	pccb->lun = dev_desc->lun;
+	pccb->lun = lun;
 	pccb->pdata = (unsigned char *)&tempbuff;
 	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, &scsi_dev_desc[scsi_max_devs]);
+			ret = scsi_detect_dev(i, lun,
+					      &scsi_dev_desc[scsi_max_devs]);
 			if (ret)
 				continue;
 
-- 
1.9.1

  parent reply	other threads:[~2017-04-07 11:42 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-07 11:41 [U-Boot] [PATCH v2 00/10] OMAP: Move SATA to use block driver model Jean-Jacques Hiblot
2017-04-07 11:42 ` [U-Boot] [PATCH v2 01/10] arm: omap: sata: move enable sata clocks to enable_basic_clocks() Jean-Jacques Hiblot
2017-04-15 16:07   ` Simon Glass
2017-04-07 11:42 ` [U-Boot] [PATCH v2 02/10] arm: omap: sata: compile out board-level sata code when CONFIG_DM_SCSI is defined Jean-Jacques Hiblot
2017-04-09  1:13   ` Tom Rini
2017-04-15 16:07     ` Simon Glass
2017-04-07 11:42 ` [U-Boot] [PATCH v2 03/10] drivers: phy: add generic PHY framework Jean-Jacques Hiblot
2017-04-09  1:13   ` Tom Rini
2017-04-09 19:27   ` Simon Glass
2017-04-13 14:17     ` Jean-Jacques Hiblot
2017-04-14 10:36       ` Simon Glass
2017-04-14 11:12         ` Jean-Jacques Hiblot
2017-04-07 11:42 ` [U-Boot] [PATCH v2 04/10] drivers: phy: add PIPE3 phy driver Jean-Jacques Hiblot
2017-04-09  1:13   ` Tom Rini
2017-04-09 19:27   ` Simon Glass
2017-04-07 11:42 ` [U-Boot] [PATCH v2 05/10] dra7: dtsi: mark ocp2scp bus compatible with "simple-bus" Jean-Jacques Hiblot
2017-04-09  1:13   ` Tom Rini
2017-04-13 14:18     ` Jean-Jacques Hiblot
2017-04-07 11:42 ` [U-Boot] [PATCH v2 06/10] drivers: block: dwc_ahci: Implement a driver for Synopsys DWC sata device Jean-Jacques Hiblot
2017-04-09  1:13   ` Tom Rini
2017-04-09 19:27   ` Simon Glass
2017-04-07 11:42 ` Jean-Jacques Hiblot [this message]
2017-04-09  1:13   ` [U-Boot] [PATCH v2 07/10] scsi: make the LUN a parameter of scsi_detect_dev() Tom Rini
2017-04-09 19:27   ` Simon Glass
2017-04-15 16:07     ` Simon Glass
2017-04-07 11:42 ` [U-Boot] [PATCH v2 08/10] scsi: move the partition initialization out of the scsi detection Jean-Jacques Hiblot
2017-04-09  1:13   ` Tom Rini
2017-04-09 19:27   ` Simon Glass
2017-04-15 16:07     ` Simon Glass
2017-04-07 11:42 ` [U-Boot] [PATCH v2 09/10] dm: scsi: fix divide-by-0 error in scsi_scan() Jean-Jacques Hiblot
2017-04-09  1:13   ` Tom Rini
2017-04-09 19:27   ` Simon Glass
2017-04-15 16:07     ` Simon Glass
2017-04-07 11:42 ` [U-Boot] [PATCH v2 10/10] defconfig: dra7xx_evm: enable CONFIG_BLK and disk driver model for SCSI Jean-Jacques Hiblot
2017-04-09  1:14   ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1491565329-20267-8-git-send-email-jjhiblot@ti.com \
    --to=jjhiblot@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.