OSDN Git Service

iio: imu: adis16400: use DEFINE_DEBUGFS_ATTRIBUTE instead of DEFINE_SIMPLE_ATTRIBUTE
authorRohit Sarkar <rohitsarkar5398@gmail.com>
Tue, 31 Mar 2020 11:47:30 +0000 (17:17 +0530)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 19 Apr 2020 15:56:25 +0000 (16:56 +0100)
commitae1d37a9bb4bd8d9091a40d153143e99b115ee37
treeafcc42188133dd16c150120ab68034c6b0636e8b
parent4ab717d9e8bdc14ce9f76d1417bc5873c4f493a1
iio: imu: adis16400: use DEFINE_DEBUGFS_ATTRIBUTE instead of DEFINE_SIMPLE_ATTRIBUTE

debugfs_create_file_unsafe does not protect the fops handed to it
against file removal. DEFINE_DEBUGFS_ATTRIBUTE makes the fops aware of
the file lifetime and thus protects it against removal.

Signed-off-by: Rohit Sarkar <rohitsarkar5398@gmail.com>
Tested-by Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/imu/adis16400.c