Skip to content

Commit

Permalink
ide: move smart_enable() call out from get_smart_data()
Browse files Browse the repository at this point in the history
Move smart_enable() call out from get_smart_data() to
proc_idedisk_read_smart().

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
bzolnier committed Mar 27, 2009
1 parent e3d9a73 commit 3937585
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/ide/ide-disk_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ static int get_smart_data(ide_drive_t *drive, u8 *buf, u8 sub_cmd)
tf->command = ATA_CMD_SMART;
args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
args.data_phase = TASKFILE_IN;
(void) smart_enable(drive);

return ide_raw_taskfile(drive, &args, buf, 1);
}

Expand Down Expand Up @@ -67,6 +67,8 @@ static int proc_idedisk_read_smart(char *page, char **start, off_t off,
ide_drive_t *drive = (ide_drive_t *)data;
int len = 0, i = 0;

(void)smart_enable(drive);

if (get_smart_data(drive, page, sub_cmd) == 0) {
unsigned short *val = (unsigned short *) page;
char *out = (char *)val + SECTOR_SIZE;
Expand Down

0 comments on commit 3937585

Please sign in to comment.