diff options
Diffstat (limited to 'drivers/platform/surface/surface_acpi_notify.c')
| -rw-r--r-- | drivers/platform/surface/surface_acpi_notify.c | 16 | 
1 files changed, 9 insertions, 7 deletions
| diff --git a/drivers/platform/surface/surface_acpi_notify.c b/drivers/platform/surface/surface_acpi_notify.c index 897cdd9c3aae..e4dee920da18 100644 --- a/drivers/platform/surface/surface_acpi_notify.c +++ b/drivers/platform/surface/surface_acpi_notify.c @@ -741,6 +741,7 @@ static bool is_san_consumer(struct platform_device *pdev, acpi_handle handle)  	struct acpi_handle_list dep_devices;  	acpi_handle supplier = ACPI_HANDLE(&pdev->dev);  	acpi_status status; +	bool ret = false;  	int i;  	if (!acpi_has_method(handle, "_DEP")) @@ -753,11 +754,14 @@ static bool is_san_consumer(struct platform_device *pdev, acpi_handle handle)  	}  	for (i = 0; i < dep_devices.count; i++) { -		if (dep_devices.handles[i] == supplier) -			return true; +		if (dep_devices.handles[i] == supplier) { +			ret = true; +			break; +		}  	} -	return false; +	acpi_handle_list_free(&dep_devices); +	return ret;  }  static acpi_status san_consumer_setup(acpi_handle handle, u32 lvl, @@ -850,7 +854,7 @@ err_enable_events:  	return status;  } -static int san_remove(struct platform_device *pdev) +static void san_remove(struct platform_device *pdev)  {  	acpi_handle san = ACPI_HANDLE(&pdev->dev); @@ -864,8 +868,6 @@ static int san_remove(struct platform_device *pdev)  	 * all delayed works they may have spawned are run to completion.  	 */  	flush_workqueue(san_wq); - -	return 0;  }  static const struct acpi_device_id san_match[] = { @@ -876,7 +878,7 @@ MODULE_DEVICE_TABLE(acpi, san_match);  static struct platform_driver surface_acpi_notify = {  	.probe = san_probe, -	.remove = san_remove, +	.remove_new = san_remove,  	.driver = {  		.name = "surface_acpi_notify",  		.acpi_match_table = san_match, |