|
|
@@ -90,8 +90,7 @@ static ssize_t pyra_sysfs_read(struct file *fp, struct kobject *kobj,
|
|
|
char *buf, loff_t off, size_t count,
|
|
|
size_t real_size, uint command)
|
|
|
{
|
|
|
- struct device *dev =
|
|
|
- container_of(kobj, struct device, kobj)->parent->parent;
|
|
|
+ struct device *dev = kobj_to_dev(kobj)->parent->parent;
|
|
|
struct pyra_device *pyra = hid_get_drvdata(dev_get_drvdata(dev));
|
|
|
struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
|
|
|
int retval;
|
|
|
@@ -116,8 +115,7 @@ static ssize_t pyra_sysfs_write(struct file *fp, struct kobject *kobj,
|
|
|
void const *buf, loff_t off, size_t count,
|
|
|
size_t real_size, uint command)
|
|
|
{
|
|
|
- struct device *dev =
|
|
|
- container_of(kobj, struct device, kobj)->parent->parent;
|
|
|
+ struct device *dev = kobj_to_dev(kobj)->parent->parent;
|
|
|
struct pyra_device *pyra = hid_get_drvdata(dev_get_drvdata(dev));
|
|
|
struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
|
|
|
int retval;
|
|
|
@@ -191,8 +189,7 @@ static ssize_t pyra_sysfs_read_profilex_settings(struct file *fp,
|
|
|
struct kobject *kobj, struct bin_attribute *attr, char *buf,
|
|
|
loff_t off, size_t count)
|
|
|
{
|
|
|
- struct device *dev =
|
|
|
- container_of(kobj, struct device, kobj)->parent->parent;
|
|
|
+ struct device *dev = kobj_to_dev(kobj)->parent->parent;
|
|
|
struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
|
|
|
ssize_t retval;
|
|
|
|
|
|
@@ -210,8 +207,7 @@ static ssize_t pyra_sysfs_read_profilex_buttons(struct file *fp,
|
|
|
struct kobject *kobj, struct bin_attribute *attr, char *buf,
|
|
|
loff_t off, size_t count)
|
|
|
{
|
|
|
- struct device *dev =
|
|
|
- container_of(kobj, struct device, kobj)->parent->parent;
|
|
|
+ struct device *dev = kobj_to_dev(kobj)->parent->parent;
|
|
|
struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
|
|
|
ssize_t retval;
|
|
|
|
|
|
@@ -248,8 +244,7 @@ static ssize_t pyra_sysfs_write_settings(struct file *fp,
|
|
|
struct kobject *kobj, struct bin_attribute *attr, char *buf,
|
|
|
loff_t off, size_t count)
|
|
|
{
|
|
|
- struct device *dev =
|
|
|
- container_of(kobj, struct device, kobj)->parent->parent;
|
|
|
+ struct device *dev = kobj_to_dev(kobj)->parent->parent;
|
|
|
struct pyra_device *pyra = hid_get_drvdata(dev_get_drvdata(dev));
|
|
|
struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
|
|
|
int retval = 0;
|