Skip to contentSkip to conversation

platform: x86: remove unnecessary platform_set_drvdata()

PATCH Applied Jingoo Han 2 participants 2 messages Aug 22, 2013 – Sep 3, 2013

Subsystems (2)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/1 platform: x86: remove unnecessary platform_set_drvdata()

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/platform/x86/compal-laptop.c      |    1 -
 drivers/platform/x86/intel_mid_powerbtn.c |    1 -
 drivers/platform/x86/intel_mid_thermal.c  |    1 -
 3 files changed, 3 deletions(-)
drivers/platform/x86/compal-laptop.c +0 -1
index 475cc52..634016a 100644
@@ -1081,7 +1081,6 @@ static int compal_remove(struct platform_device *pdev)
 	hwmon_device_unregister(data->hwmon_dev);
 	power_supply_unregister(&data->psy);
 
-	platform_set_drvdata(pdev, NULL);
 	kfree(data);
 
 	sysfs_remove_group(&pdev->dev.kobj, &compal_attribute_group);
drivers/platform/x86/intel_mid_powerbtn.c +0 -1
index f59683a..6b18aba 100644
@@ -128,7 +128,6 @@ static int mfld_pb_remove(struct platform_device *pdev)
 
 	free_irq(irq, input);
 	input_unregister_device(input);
-	platform_set_drvdata(pdev, NULL);
 
 	return 0;
 }
drivers/platform/x86/intel_mid_thermal.c +0 -1
index 81c491e..93fab8b 100644
@@ -542,7 +542,6 @@ static int mid_thermal_remove(struct platform_device *pdev)
 	}
 
 	kfree(pinfo);
-	platform_set_drvdata(pdev, NULL);
 
 	/* Stop the ADC */
 	return configure_adc(0);
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 3 lines · Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

Applied, thanks.

Signature · 1 line
Matthew Garrett <[email protected]>