Skip to content

Commit 18a0393

Browse files
Jingoo HanMatthew Garrett
authored andcommitted
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. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
1 parent 0be18a8 commit 18a0393

File tree

3 files changed

+0
-3
lines changed

3 files changed

+0
-3
lines changed

drivers/platform/x86/compal-laptop.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,6 @@ static int compal_remove(struct platform_device *pdev)
10831083
hwmon_device_unregister(data->hwmon_dev);
10841084
power_supply_unregister(&data->psy);
10851085

1086-
platform_set_drvdata(pdev, NULL);
10871086
kfree(data);
10881087

10891088
sysfs_remove_group(&pdev->dev.kobj, &compal_attribute_group);

drivers/platform/x86/intel_mid_powerbtn.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ static int mfld_pb_remove(struct platform_device *pdev)
128128

129129
free_irq(irq, input);
130130
input_unregister_device(input);
131-
platform_set_drvdata(pdev, NULL);
132131

133132
return 0;
134133
}

drivers/platform/x86/intel_mid_thermal.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,6 @@ static int mid_thermal_remove(struct platform_device *pdev)
542542
}
543543

544544
kfree(pinfo);
545-
platform_set_drvdata(pdev, NULL);
546545

547546
/* Stop the ADC */
548547
return configure_adc(0);

0 commit comments

Comments
 (0)