diff options
| author | 2026-08-30 21:46:44 -0600 | |
|---|---|---|
| committer | 2026-08-30 21:49:59 -0600 | |
| commit | 26f5abb98a9cde6825d3cdb12a690d0ea7ede5b4 (patch) | |
| tree | aa9f626f8356a457a9bd517da0093acaa1b4af47 | |
| parent | virt: vmgenid: set driver_data before registering notification handlers (diff) | |
The prior commit moved the order of initializing driver_data around. In
looking through the tree at what is normally done, it appears that
actually few drives set or get driver_data directly, but instead go
through the dev_set/get_drvdata helpers, which are simple inline helpers
that amount to the same exact code. So, for the sake of consistency, use
the helpers.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
| -rw-r--r-- | drivers/virt/vmgenid.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/virt/vmgenid.c b/drivers/virt/vmgenid.c index 0d269edf283d..ce957f5b1c31 100644 --- a/drivers/virt/vmgenid.c +++ b/drivers/virt/vmgenid.c @@ -25,7 +25,7 @@ struct vmgenid_state { static void vmgenid_notify(struct device *device) { - struct vmgenid_state *state = device->driver_data; + struct vmgenid_state *state = dev_get_drvdata(device); u8 old_id[VMGENID_SIZE]; memcpy(old_id, state->this_id, sizeof(old_id)); @@ -83,7 +83,7 @@ static int vmgenid_add_acpi(struct device *dev, struct vmgenid_state *state) } setup_vmgenid_state(state, virt_addr); - dev->driver_data = state; + dev_set_drvdata(dev, state); status = acpi_install_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, vmgenid_acpi_handler, dev); @@ -125,7 +125,7 @@ static int vmgenid_add_of(struct platform_device *pdev, if (ret < 0) return ret; - pdev->dev.driver_data = state; + dev_set_drvdata(&pdev->dev, state); ret = devm_request_irq(&pdev->dev, ret, vmgenid_of_irq_handler, IRQF_SHARED, "vmgenid", &pdev->dev); |
