|
@@ -269,8 +269,7 @@ static int kone_get_firmware_version(struct usb_device *usb_dev, int *result)
|
|
|
static ssize_t kone_sysfs_read_settings(struct file *fp, struct kobject *kobj,
|
|
static ssize_t kone_sysfs_read_settings(struct file *fp, struct kobject *kobj,
|
|
|
struct bin_attribute *attr, char *buf,
|
|
struct bin_attribute *attr, char *buf,
|
|
|
loff_t off, size_t count) {
|
|
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 kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev));
|
|
struct kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev));
|
|
|
|
|
|
|
|
if (off >= sizeof(struct kone_settings))
|
|
if (off >= sizeof(struct kone_settings))
|
|
@@ -294,8 +293,7 @@ static ssize_t kone_sysfs_read_settings(struct file *fp, struct kobject *kobj,
|
|
|
static ssize_t kone_sysfs_write_settings(struct file *fp, struct kobject *kobj,
|
|
static ssize_t kone_sysfs_write_settings(struct file *fp, struct kobject *kobj,
|
|
|
struct bin_attribute *attr, char *buf,
|
|
struct bin_attribute *attr, char *buf,
|
|
|
loff_t off, size_t count) {
|
|
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 kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev));
|
|
struct kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev));
|
|
|
struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
|
|
struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
|
|
|
int retval = 0, difference, old_profile;
|
|
int retval = 0, difference, old_profile;
|
|
@@ -332,8 +330,7 @@ static BIN_ATTR(settings, 0660, kone_sysfs_read_settings,
|
|
|
static ssize_t kone_sysfs_read_profilex(struct file *fp,
|
|
static ssize_t kone_sysfs_read_profilex(struct file *fp,
|
|
|
struct kobject *kobj, struct bin_attribute *attr,
|
|
struct kobject *kobj, struct bin_attribute *attr,
|
|
|
char *buf, loff_t off, size_t count) {
|
|
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 kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev));
|
|
struct kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev));
|
|
|
|
|
|
|
|
if (off >= sizeof(struct kone_profile))
|
|
if (off >= sizeof(struct kone_profile))
|
|
@@ -353,8 +350,7 @@ static ssize_t kone_sysfs_read_profilex(struct file *fp,
|
|
|
static ssize_t kone_sysfs_write_profilex(struct file *fp,
|
|
static ssize_t kone_sysfs_write_profilex(struct file *fp,
|
|
|
struct kobject *kobj, struct bin_attribute *attr,
|
|
struct kobject *kobj, struct bin_attribute *attr,
|
|
|
char *buf, loff_t off, size_t count) {
|
|
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 kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev));
|
|
struct kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev));
|
|
|
struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
|
|
struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
|
|
|
struct kone_profile *profile;
|
|
struct kone_profile *profile;
|