powerpc/papr_scm: use dev_get_drvdata
authorHaowen Bai <baihaowen@meizu.com>
Tue, 31 May 2022 09:19:50 +0000 (17:19 +0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 29 Jun 2022 09:37:07 +0000 (19:37 +1000)
Eliminate direct accesses to the driver_data field.

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1653988790-19999-1-git-send-email-baihaowen@meizu.com
arch/powerpc/platforms/pseries/papr_scm.c

index 82cae08..69f21d3 100644 (file)
@@ -354,7 +354,7 @@ static int papr_scm_pmu_get_value(struct perf_event *event, struct device *dev,
 {
        struct papr_scm_perf_stat *stat;
        struct papr_scm_perf_stats *stats;
-       struct papr_scm_priv *p = (struct papr_scm_priv *)dev->driver_data;
+       struct papr_scm_priv *p = dev_get_drvdata(dev);
        int rc, size;
 
        /* Allocate request buffer enough to hold single performance stat */