diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2007-03-08 18:09:12 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-04-28 14:15:58 -0400 |
commit | 9d2c7c75f889a3eefad016c71f651b0796e0a6e9 (patch) | |
tree | 3162001038408e49bca847dc38bc47db49649b7f | |
parent | 432729f0b0c299ae9731aaa31beaa0dd3a9751eb (diff) |
sata_sil: First step to removing ->post_set_mode
Now that we have ata_do_set_mode() available for drivers to use we don't
actually need ->post_set_mode() as the driver can wrap set_mode nicely
and do stuff before or after (eg PCMCIA needs before), so we can kill off
a method in all the structs
While I was at it I added kernel-doc to the function involved.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r-- | drivers/ata/sata_sil.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c index 170d36e6260f..466b05b67115 100644 --- a/drivers/ata/sata_sil.c +++ b/drivers/ata/sata_sil.c | |||
@@ -46,7 +46,7 @@ | |||
46 | #include <linux/libata.h> | 46 | #include <linux/libata.h> |
47 | 47 | ||
48 | #define DRV_NAME "sata_sil" | 48 | #define DRV_NAME "sata_sil" |
49 | #define DRV_VERSION "2.1" | 49 | #define DRV_VERSION "2.2" |
50 | 50 | ||
51 | enum { | 51 | enum { |
52 | SIL_MMIO_BAR = 5, | 52 | SIL_MMIO_BAR = 5, |
@@ -117,7 +117,7 @@ static int sil_pci_device_resume(struct pci_dev *pdev); | |||
117 | static void sil_dev_config(struct ata_device *dev); | 117 | static void sil_dev_config(struct ata_device *dev); |
118 | static u32 sil_scr_read (struct ata_port *ap, unsigned int sc_reg); | 118 | static u32 sil_scr_read (struct ata_port *ap, unsigned int sc_reg); |
119 | static void sil_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); | 119 | static void sil_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); |
120 | static void sil_post_set_mode (struct ata_port *ap); | 120 | static int sil_set_mode (struct ata_port *ap, struct ata_device **r_failed); |
121 | static irqreturn_t sil_interrupt(int irq, void *dev_instance); | 121 | static irqreturn_t sil_interrupt(int irq, void *dev_instance); |
122 | static void sil_freeze(struct ata_port *ap); | 122 | static void sil_freeze(struct ata_port *ap); |
123 | static void sil_thaw(struct ata_port *ap); | 123 | static void sil_thaw(struct ata_port *ap); |
@@ -197,7 +197,7 @@ static const struct ata_port_operations sil_ops = { | |||
197 | .check_status = ata_check_status, | 197 | .check_status = ata_check_status, |
198 | .exec_command = ata_exec_command, | 198 | .exec_command = ata_exec_command, |
199 | .dev_select = ata_std_dev_select, | 199 | .dev_select = ata_std_dev_select, |
200 | .post_set_mode = sil_post_set_mode, | 200 | .set_mode = sil_set_mode, |
201 | .bmdma_setup = ata_bmdma_setup, | 201 | .bmdma_setup = ata_bmdma_setup, |
202 | .bmdma_start = ata_bmdma_start, | 202 | .bmdma_start = ata_bmdma_start, |
203 | .bmdma_stop = ata_bmdma_stop, | 203 | .bmdma_stop = ata_bmdma_stop, |
@@ -297,7 +297,16 @@ static unsigned char sil_get_device_cache_line(struct pci_dev *pdev) | |||
297 | return cache_line; | 297 | return cache_line; |
298 | } | 298 | } |
299 | 299 | ||
300 | static void sil_post_set_mode (struct ata_port *ap) | 300 | /** |
301 | * sil_set_mode - wrap set_mode functions | ||
302 | * @ap: port to set up | ||
303 | * @r_failed: returned device when we fail | ||
304 | * | ||
305 | * Wrap the libata method for device setup as after the setup we need | ||
306 | * to inspect the results and do some configuration work | ||
307 | */ | ||
308 | |||
309 | static int sil_set_mode (struct ata_port *ap, struct ata_device **r_failed) | ||
301 | { | 310 | { |
302 | struct ata_host *host = ap->host; | 311 | struct ata_host *host = ap->host; |
303 | struct ata_device *dev; | 312 | struct ata_device *dev; |
@@ -305,6 +314,11 @@ static void sil_post_set_mode (struct ata_port *ap) | |||
305 | void __iomem *addr = mmio_base + sil_port[ap->port_no].xfer_mode; | 314 | void __iomem *addr = mmio_base + sil_port[ap->port_no].xfer_mode; |
306 | u32 tmp, dev_mode[2]; | 315 | u32 tmp, dev_mode[2]; |
307 | unsigned int i; | 316 | unsigned int i; |
317 | int rc; | ||
318 | |||
319 | rc = ata_do_set_mode(ap, r_failed); | ||
320 | if (rc) | ||
321 | return rc; | ||
308 | 322 | ||
309 | for (i = 0; i < 2; i++) { | 323 | for (i = 0; i < 2; i++) { |
310 | dev = &ap->device[i]; | 324 | dev = &ap->device[i]; |
@@ -323,6 +337,7 @@ static void sil_post_set_mode (struct ata_port *ap) | |||
323 | tmp |= (dev_mode[1] << 4); | 337 | tmp |= (dev_mode[1] << 4); |
324 | writel(tmp, addr); | 338 | writel(tmp, addr); |
325 | readl(addr); /* flush */ | 339 | readl(addr); /* flush */ |
340 | return 0; | ||
326 | } | 341 | } |
327 | 342 | ||
328 | static inline void __iomem *sil_scr_addr(struct ata_port *ap, unsigned int sc_reg) | 343 | static inline void __iomem *sil_scr_addr(struct ata_port *ap, unsigned int sc_reg) |