From b5bd70a162492a76ee49065605ca15d484bb623a Mon Sep 17 00:00:00 2001
From: wwang <wei_wang@realsil.com.cn>
Date: Tue, 27 Mar 2012 16:43:20 +0800
Subject: [PATCH] staging:rts_pstor:Avoid "Bad target number" message when probing driver
Git-commit: b5bd70a162492a76ee49065605ca15d484bb623a
Patch-mainline: 3.4-rc3
References: bnc#762329

Avoid "Bad LUN" and "Bad target number" message by setting the supported
max_lun and max_id for the scsi host

Signed-off-by: wwang <wei_wang@realsil.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Takashi Iwai <tiwai@suse.de>

---
 drivers/staging/rts_pstor/rtsx.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/drivers/staging/rts_pstor/rtsx.c
+++ b/drivers/staging/rts_pstor/rtsx.c
@@ -994,6 +994,11 @@ static int __devinit rtsx_probe(struct p
 
 	rtsx_init_chip(dev->chip);
 
+	/* set the supported max_lun and max_id for the scsi host
+	 * NOTE: the minimal value of max_id is 1 */
+	host->max_id = 1;
+	host->max_lun = dev->chip->max_lun;
+
 	/* Start up our control thread */
 	th = kthread_run(rtsx_control_thread, dev, CR_DRIVER_NAME);
 	if (IS_ERR(th)) {
