diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2020-01-21 16:06:42 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-01-30 13:03:24 +0300 |
commit | 2fd3c5c617937cde5aafa48db4f4056e1f705987 (patch) | |
tree | 05bece251a79b561d0e2734117ea2532233e2bc8 /include | |
parent | ce1f31b4c0b9551dd51874dd5364654ed4ca13ae (diff) | |
download | linux-2fd3c5c617937cde5aafa48db4f4056e1f705987.tar.xz |
ide: make drive->dn read only
The IDE core always sets ->dn correctly so changing it is never
required.
Setting it to a different value than assigned by IDE core is very likely
to result in data corruption (due to wrong transfer timings being set on
the controller etc.)
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Tested-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ide.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index 46b771d6999e..25046ffa5a4a 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -943,6 +943,10 @@ ide_devset_get(_name, _field); \ ide_devset_set(_name, _field); \ IDE_DEVSET(_name, DS_SYNC, get_##_name, set_##_name) +#define ide_devset_ro_field(_name, _field) \ +ide_devset_get(_name, _field); \ +IDE_DEVSET(_name, 0, get_##_name, NULL) + #define ide_devset_rw_flag(_name, _field) \ ide_devset_get_flag(_name, _field); \ ide_devset_set_flag(_name, _field); \ |