提交 08df5d47 编写于 作者: M Michał Kępień 提交者: Darren Hart (VMware)

platform/x86: fujitsu-laptop: remove redundant safety checks

Do not check whether the pointer passed to ACPI add callbacks is NULL as
it is earlier dereferenced anyway in the bus-level probe callback,
acpi_device_probe().

Do not check the value of acpi_disabled in fujitsu_init(), because it is
already done by acpi_bus_register_driver(), which is the first function
called by fujitsu_init().
Signed-off-by: NMichał Kępień <kernel@kempniu.pl>
Reviewed-by: NJonathan Woithe <jwoithe@just42.net>
Signed-off-by: NDarren Hart (VMware) <dvhart@infradead.org>
上级 79e19ab5
...@@ -408,9 +408,6 @@ static int acpi_fujitsu_bl_add(struct acpi_device *device) ...@@ -408,9 +408,6 @@ static int acpi_fujitsu_bl_add(struct acpi_device *device)
if (acpi_video_get_backlight_type() != acpi_backlight_vendor) if (acpi_video_get_backlight_type() != acpi_backlight_vendor)
return -ENODEV; return -ENODEV;
if (!device)
return -EINVAL;
priv = devm_kzalloc(&device->dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(&device->dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
...@@ -798,9 +795,6 @@ static int acpi_fujitsu_laptop_add(struct acpi_device *device) ...@@ -798,9 +795,6 @@ static int acpi_fujitsu_laptop_add(struct acpi_device *device)
int error; int error;
int i; int i;
if (!device)
return -EINVAL;
priv = devm_kzalloc(&device->dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(&device->dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
...@@ -1019,9 +1013,6 @@ static int __init fujitsu_init(void) ...@@ -1019,9 +1013,6 @@ static int __init fujitsu_init(void)
{ {
int ret; int ret;
if (acpi_disabled)
return -ENODEV;
ret = acpi_bus_register_driver(&acpi_fujitsu_bl_driver); ret = acpi_bus_register_driver(&acpi_fujitsu_bl_driver);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册