]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/ide-proc.c
ide: WIN_* -> ATA_CMD_*
[linux-2.6-omap-h63xx.git] / drivers / ide / ide-proc.c
index 151c91e933dab156adb2606f4a55384fc4866ad0..22f41fa4e5b6f262455e9badee0503cb1178c660 100644 (file)
  * "settings" files.  e.g.    "cat /proc/ide0/hda/settings"
  * To write a new value "val" into a specific setting "name", use:
  *   echo "name:val" >/proc/ide/ide0/hda/settings
- *
- * Also useful, "cat /proc/ide0/hda/[identify, smart_values,
- * smart_thresholds, capabilities]" will issue an IDENTIFY /
- * PACKET_IDENTIFY / SMART_READ_VALUES / SMART_READ_THRESHOLDS /
- * SENSE CAPABILITIES command to /dev/hda, and then dump out the
- * returned data as 256 16-bit words.  The "hdparm" utility will
- * be updated someday soon to use this mechanism.
- *
  */
 
 #include <linux/module.h>
@@ -105,7 +97,7 @@ static int proc_ide_read_identify
        len = sprintf(page, "\n");
 
        if (drive) {
-               unsigned short *val = (unsigned short *) page;
+               __le16 *val = (__le16 *)page;
 
                err = taskfile_lib_get_identify(drive, page);
                if (!err) {
@@ -113,7 +105,7 @@ static int proc_ide_read_identify
                        page = out;
                        do {
                                out += sprintf(out, "%04x%c",
-                                       le16_to_cpu(*val), (++i & 7) ? ' ' : '\n');
+                                       le16_to_cpup(val), (++i & 7) ? ' ' : '\n');
                                val += 1;
                        } while (i < (SECTOR_WORDS * 2));
                        len = out - page;
@@ -349,7 +341,7 @@ static int set_xfer_rate (ide_drive_t *drive, int arg)
                return -EINVAL;
 
        memset(&task, 0, sizeof(task));
-       task.tf.command = WIN_SETFEATURES;
+       task.tf.command = ATA_CMD_SET_FEATURES;
        task.tf.feature = SETFEATURES_XFER;
        task.tf.nsect   = (u8)arg;
        task.tf_flags = IDE_TFLAG_OUT_FEATURE | IDE_TFLAG_OUT_NSECT |
@@ -561,11 +553,10 @@ static int proc_ide_read_dmodel
        (char *page, char **start, off_t off, int count, int *eof, void *data)
 {
        ide_drive_t     *drive = (ide_drive_t *) data;
-       struct hd_driveid *id = drive->id;
+       char            *m = (char *)&drive->id[ATA_ID_PROD];
        int             len;
 
-       len = sprintf(page, "%.40s\n",
-               (id && id->model[0]) ? (char *)id->model : "(none)");
+       len = sprintf(page, "%.40s\n", m[0] ? m : "(none)");
        PROC_IDE_READ_RETURN(page, start, off, count, eof, len);
 }