Patchwork [14/68] pata_sis: move short cable handling to pata_sis.h

login
register
mail settings
Submitter Bartlomiej Zolnierkiewicz
Date Jan. 29, 2010, 4:04 p.m.
Message ID <20100129160440.21495.4832.sendpatchset@localhost>
Download mbox | patch
Permalink /patch/43937/
State RFC
Delegated to: David Miller
Headers show

Comments

Bartlomiej Zolnierkiewicz - Jan. 29, 2010, 4:04 p.m.
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] pata_sis: move short cable handling to pata_sis.h

It is a generic code and can be shared between pata_sis & sis5513 drivers.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ata/pata_sis.c |   30 +-----------------------------
 drivers/ata/pata_sis.h |   30 ++++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 29 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

Index: b/drivers/ata/pata_sis.c
===================================================================
--- a/drivers/ata/pata_sis.c
+++ b/drivers/ata/pata_sis.c
@@ -45,35 +45,7 @@  struct sis_chipset {
 	   up code later */
 };
 
-struct sis_laptop {
-	u16 device;
-	u16 subvendor;
-	u16 subdevice;
-};
-
-static const struct sis_laptop sis_laptop[] = {
-	/* devid, subvendor, subdev */
-	{ 0x5513, 0x1043, 0x1107 },	/* ASUS A6K */
-	{ 0x5513, 0x1734, 0x105F },	/* FSC Amilo A1630 */
-	{ 0x5513, 0x1071, 0x8640 },     /* EasyNote K5305 */
-	/* end marker */
-	{ 0, }
-};
-
-static int sis_short_ata40(struct pci_dev *dev)
-{
-	const struct sis_laptop *lap = &sis_laptop[0];
-
-	while (lap->device) {
-		if (lap->device == dev->device &&
-		    lap->subvendor == dev->subsystem_vendor &&
-		    lap->subdevice == dev->subsystem_device)
-			return 1;
-		lap++;
-	}
-
-	return 0;
-}
+#include "pata_sis.h"
 
 /**
  *	sis_old_port_base		-	return PCI configuration base for dev
Index: b/drivers/ata/pata_sis.h
===================================================================
--- /dev/null
+++ b/drivers/ata/pata_sis.h
@@ -0,0 +1,30 @@ 
+
+struct sis_laptop {
+	u16 device;
+	u16 subvendor;
+	u16 subdevice;
+};
+
+static const struct sis_laptop sis_laptop[] = {
+	/* devid, subvendor, subdev */
+	{ 0x5513, 0x1043, 0x1107 },	/* ASUS A6K */
+	{ 0x5513, 0x1734, 0x105F },	/* FSC Amilo A1630 */
+	{ 0x5513, 0x1071, 0x8640 },     /* EasyNote K5305 */
+	/* end marker */
+	{ 0, }
+};
+
+static int sis_short_ata40(struct pci_dev *dev)
+{
+	const struct sis_laptop *lap = &sis_laptop[0];
+
+	while (lap->device) {
+		if (lap->device == dev->device &&
+		    lap->subvendor == dev->subsystem_vendor &&
+		    lap->subdevice == dev->subsystem_device)
+			return 1;
+		lap++;
+	}
+
+	return 0;
+}