aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hosts.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/scsi/hosts.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/scsi/hosts.c')
-rw-r--r--drivers/scsi/hosts.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index c968cc31cd86..6660fa92ffa1 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -24,6 +24,7 @@
24#include <linux/module.h> 24#include <linux/module.h>
25#include <linux/blkdev.h> 25#include <linux/blkdev.h>
26#include <linux/kernel.h> 26#include <linux/kernel.h>
27#include <linux/slab.h>
27#include <linux/kthread.h> 28#include <linux/kthread.h>
28#include <linux/string.h> 29#include <linux/string.h>
29#include <linux/mm.h> 30#include <linux/mm.h>
@@ -180,14 +181,20 @@ void scsi_remove_host(struct Scsi_Host *shost)
180EXPORT_SYMBOL(scsi_remove_host); 181EXPORT_SYMBOL(scsi_remove_host);
181 182
182/** 183/**
183 * scsi_add_host - add a scsi host 184 * scsi_add_host_with_dma - add a scsi host with dma device
184 * @shost: scsi host pointer to add 185 * @shost: scsi host pointer to add
185 * @dev: a struct device of type scsi class 186 * @dev: a struct device of type scsi class
187 * @dma_dev: dma device for the host
188 *
189 * Note: You rarely need to worry about this unless you're in a
190 * virtualised host environments, so use the simpler scsi_add_host()
191 * function instead.
186 * 192 *
187 * Return value: 193 * Return value:
188 * 0 on success / != 0 for error 194 * 0 on success / != 0 for error
189 **/ 195 **/
190int scsi_add_host(struct Scsi_Host *shost, struct device *dev) 196int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
197 struct device *dma_dev)
191{ 198{
192 struct scsi_host_template *sht = shost->hostt; 199 struct scsi_host_template *sht = shost->hostt;
193 int error = -EINVAL; 200 int error = -EINVAL;
@@ -207,6 +214,9 @@ int scsi_add_host(struct Scsi_Host *shost, struct device *dev)
207 214
208 if (!shost->shost_gendev.parent) 215 if (!shost->shost_gendev.parent)
209 shost->shost_gendev.parent = dev ? dev : &platform_bus; 216 shost->shost_gendev.parent = dev ? dev : &platform_bus;
217 shost->dma_dev = dma_dev;
218
219 device_enable_async_suspend(&shost->shost_gendev);
210 220
211 error = device_add(&shost->shost_gendev); 221 error = device_add(&shost->shost_gendev);
212 if (error) 222 if (error)
@@ -215,6 +225,8 @@ int scsi_add_host(struct Scsi_Host *shost, struct device *dev)
215 scsi_host_set_state(shost, SHOST_RUNNING); 225 scsi_host_set_state(shost, SHOST_RUNNING);
216 get_device(shost->shost_gendev.parent); 226 get_device(shost->shost_gendev.parent);
217 227
228 device_enable_async_suspend(&shost->shost_dev);
229
218 error = device_add(&shost->shost_dev); 230 error = device_add(&shost->shost_dev);
219 if (error) 231 if (error)
220 goto out_del_gendev; 232 goto out_del_gendev;
@@ -262,7 +274,7 @@ int scsi_add_host(struct Scsi_Host *shost, struct device *dev)
262 fail: 274 fail:
263 return error; 275 return error;
264} 276}
265EXPORT_SYMBOL(scsi_add_host); 277EXPORT_SYMBOL(scsi_add_host_with_dma);
266 278
267static void scsi_host_dev_release(struct device *dev) 279static void scsi_host_dev_release(struct device *dev)
268{ 280{