struct huawei_wmi_debug debug;
struct input_dev *idev[2];
struct led_classdev cdev;
- struct platform_device *pdev;
+ struct device *dev;
struct mutex battery_lock;
struct mutex wmi_lock;
status = wmi_evaluate_method(HWMI_METHOD_GUID, 0, 1, in, out);
mutex_unlock(&huawei_wmi->wmi_lock);
if (ACPI_FAILURE(status)) {
- dev_err(&huawei_wmi->pdev->dev, "Failed to evaluate wmi method\n");
+ dev_err(huawei_wmi->dev, "Failed to evaluate wmi method\n");
return -ENODEV;
}
obj->buffer.pointer += 4;
len = 0x100;
} else {
- dev_err(&huawei_wmi->pdev->dev, "Bad buffer length, got %d\n", obj->buffer.length);
+ dev_err(huawei_wmi->dev, "Bad buffer length, got %d\n", obj->buffer.length);
err = -EIO;
goto fail_cmd;
}
*/
case ACPI_TYPE_PACKAGE:
if (obj->package.count != 2) {
- dev_err(&huawei_wmi->pdev->dev, "Bad package count, got %d\n", obj->package.count);
+ dev_err(huawei_wmi->dev, "Bad package count, got %d\n", obj->package.count);
err = -EIO;
goto fail_cmd;
}
obj = &obj->package.elements[1];
if (obj->type != ACPI_TYPE_BUFFER) {
- dev_err(&huawei_wmi->pdev->dev, "Bad package element type, got %d\n", obj->type);
+ dev_err(huawei_wmi->dev, "Bad package element type, got %d\n", obj->type);
err = -EIO;
goto fail_cmd;
}
break;
/* Shouldn't get here! */
default:
- dev_err(&huawei_wmi->pdev->dev, "Unexpected obj type, got: %d\n", obj->type);
+ dev_err(huawei_wmi->dev, "Unexpected obj type, got: %d\n", obj->type);
err = -EIO;
goto fail_cmd;
}
seq_puts(m, "]");
break;
default:
- dev_err(&huawei->pdev->dev, "Unexpected obj type, got %d\n", obj->type);
+ dev_err(huawei->dev, "Unexpected obj type, got %d\n", obj->type);
return;
}
}
int err;
platform_set_drvdata(pdev, huawei_wmi);
- huawei_wmi->pdev = pdev;
+ huawei_wmi->dev = &pdev->dev;
while (*guid->guid_string) {
struct input_dev *idev = *huawei_wmi->idev;
static __exit void huawei_wmi_exit(void)
{
- platform_device_unregister(huawei_wmi->pdev);
+ struct platform_device *pdev = to_platform_device(huawei_wmi->dev);
+
+ platform_device_unregister(pdev);
platform_driver_unregister(&huawei_wmi_driver);
kfree(huawei_wmi);