libata: uninline atapi_cmd_type()
authorTejun Heo <htejun@gmail.com>
Wed, 2 Apr 2008 08:28:46 +0000 (17:28 +0900)
committerJeff Garzik <jeff@garzik.org>
Fri, 4 Apr 2008 06:43:35 +0000 (02:43 -0400)
Uninline atapi_cmd_type().  It doesn't really have to be inline and
more case will be added which need to access unexported libata
variable.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/ata/libata-core.c
include/linux/libata.h

index 2db5c9c9ca10b00b327bf1297daaaec12bc3629c..e9b69ba489d28930a3f5ee3d80fe99ca4283ca17 100644 (file)
@@ -325,6 +325,39 @@ static void ata_force_horkage(struct ata_device *dev)
        }
 }
 
+/**
+ *     atapi_cmd_type - Determine ATAPI command type from SCSI opcode
+ *     @opcode: SCSI opcode
+ *
+ *     Determine ATAPI command type from @opcode.
+ *
+ *     LOCKING:
+ *     None.
+ *
+ *     RETURNS:
+ *     ATAPI_{READ|WRITE|READ_CD|PASS_THRU|MISC}
+ */
+int atapi_cmd_type(u8 opcode)
+{
+       switch (opcode) {
+       case GPCMD_READ_10:
+       case GPCMD_READ_12:
+               return ATAPI_READ;
+
+       case GPCMD_WRITE_10:
+       case GPCMD_WRITE_12:
+       case GPCMD_WRITE_AND_VERIFY_10:
+               return ATAPI_WRITE;
+
+       case GPCMD_READ_CD:
+       case GPCMD_READ_CD_MSF:
+               return ATAPI_READ_CD;
+
+       default:
+               return ATAPI_MISC;
+       }
+}
+
 /**
  *     ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure
  *     @tf: Taskfile to convert
@@ -7774,6 +7807,7 @@ EXPORT_SYMBOL_GPL(ata_tf_read);
 EXPORT_SYMBOL_GPL(ata_noop_dev_select);
 EXPORT_SYMBOL_GPL(ata_std_dev_select);
 EXPORT_SYMBOL_GPL(sata_print_link_status);
+EXPORT_SYMBOL_GPL(atapi_cmd_type);
 EXPORT_SYMBOL_GPL(ata_tf_to_fis);
 EXPORT_SYMBOL_GPL(ata_tf_from_fis);
 EXPORT_SYMBOL_GPL(ata_pack_xfermask);
index b064bfeb69ee236a189aa1d1c81adad8df24fbf8..92c64909ed251636b1bf60c129c57190e4d36a30 100644 (file)
@@ -849,6 +849,7 @@ extern unsigned int ata_dev_try_classify(struct ata_device *dev, int present,
  */
 extern void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf);
 extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf);
+extern int atapi_cmd_type(u8 opcode);
 extern void ata_tf_to_fis(const struct ata_taskfile *tf,
                          u8 pmp, int is_cmd, u8 *fis);
 extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf);
@@ -1379,27 +1380,6 @@ static inline int ata_try_flush_cache(const struct ata_device *dev)
               ata_id_has_flush_ext(dev->id);
 }
 
-static inline int atapi_cmd_type(u8 opcode)
-{
-       switch (opcode) {
-       case GPCMD_READ_10:
-       case GPCMD_READ_12:
-               return ATAPI_READ;
-
-       case GPCMD_WRITE_10:
-       case GPCMD_WRITE_12:
-       case GPCMD_WRITE_AND_VERIFY_10:
-               return ATAPI_WRITE;
-
-       case GPCMD_READ_CD:
-       case GPCMD_READ_CD_MSF:
-               return ATAPI_READ_CD;
-
-       default:
-               return ATAPI_MISC;
-       }
-}
-
 static inline unsigned int ac_err_mask(u8 status)
 {
        if (status & (ATA_BUSY | ATA_DRQ))