dio-sysfs.c (a8b3e6f10f08f66ae1072efd087b30966a3654f6) | dio-sysfs.c (2e4c77bea3d8b17d94f8ee382411f359b708560f) |
---|---|
1/* 2 * File Attributes for DIO Devices 3 * 4 * Copyright (C) 2004 Jochen Friedrich 5 * 6 * Loosely based on drivers/pci/pci-sysfs.c and drivers/zorro/zorro-sysfs.c 7 * 8 * This file is subject to the terms and conditions of the GNU General Public --- 49 unchanged lines hidden (view full) --- 58 struct dio_dev *d = to_dio_dev(dev); 59 60 return sprintf(buf, "0x%08lx 0x%08lx 0x%08lx\n", 61 dio_resource_start(d), dio_resource_end(d), 62 dio_resource_flags(d)); 63} 64static DEVICE_ATTR(resource, S_IRUGO, dio_show_resource, NULL); 65 | 1/* 2 * File Attributes for DIO Devices 3 * 4 * Copyright (C) 2004 Jochen Friedrich 5 * 6 * Loosely based on drivers/pci/pci-sysfs.c and drivers/zorro/zorro-sysfs.c 7 * 8 * This file is subject to the terms and conditions of the GNU General Public --- 49 unchanged lines hidden (view full) --- 58 struct dio_dev *d = to_dio_dev(dev); 59 60 return sprintf(buf, "0x%08lx 0x%08lx 0x%08lx\n", 61 dio_resource_start(d), dio_resource_end(d), 62 dio_resource_flags(d)); 63} 64static DEVICE_ATTR(resource, S_IRUGO, dio_show_resource, NULL); 65 |
66void dio_create_sysfs_dev_files(struct dio_dev *d) | 66int dio_create_sysfs_dev_files(struct dio_dev *d) |
67{ 68 struct device *dev = &d->dev; | 67{ 68 struct device *dev = &d->dev; |
69 int error; |
|
69 70 /* current configuration's attributes */ | 70 71 /* current configuration's attributes */ |
71 device_create_file(dev, &dev_attr_id); 72 device_create_file(dev, &dev_attr_ipl); 73 device_create_file(dev, &dev_attr_secid); 74 device_create_file(dev, &dev_attr_name); 75 device_create_file(dev, &dev_attr_resource); | 72 if ((error = device_create_file(dev, &dev_attr_id)) || 73 (error = device_create_file(dev, &dev_attr_ipl)) || 74 (error = device_create_file(dev, &dev_attr_secid)) || 75 (error = device_create_file(dev, &dev_attr_name)) || 76 (error = device_create_file(dev, &dev_attr_resource))) 77 return error; 78 79 return 0; |
76} 77 | 80} 81 |