aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFuqian Huang <huangfq.daxian@gmail.com>2019-07-03 22:36:27 -0400
committerJassi Brar <jaswinder.singh@linaro.org>2019-07-11 00:08:44 -0400
commit7836922d87175dbc9bc972a1aca08d2c8b6f5045 (patch)
treebd37d040640f17494c498e5607cf667ca4f879da
parent11108f4671bda6bf93bea5455210346a0ccbaa10 (diff)
mailbox: bcm-flexrm-mailbox: using dev_get_drvdata directly
Several drivers cast a struct device pointer to a struct platform_device pointer only to then call platform_get_drvdata(). To improve readability, these constructs can be simplified by using dev_get_drvdata() directly. Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
-rw-r--r--drivers/mailbox/bcm-flexrm-mailbox.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/mailbox/bcm-flexrm-mailbox.c b/drivers/mailbox/bcm-flexrm-mailbox.c
index a64116586b4c..0cfdd53d04a1 100644
--- a/drivers/mailbox/bcm-flexrm-mailbox.c
+++ b/drivers/mailbox/bcm-flexrm-mailbox.c
@@ -1165,8 +1165,7 @@ static int flexrm_process_completions(struct flexrm_ring *ring)
1165 1165
1166static int flexrm_debugfs_conf_show(struct seq_file *file, void *offset) 1166static int flexrm_debugfs_conf_show(struct seq_file *file, void *offset)
1167{ 1167{
1168 struct platform_device *pdev = to_platform_device(file->private); 1168 struct flexrm_mbox *mbox = dev_get_drvdata(file->private);
1169 struct flexrm_mbox *mbox = platform_get_drvdata(pdev);
1170 1169
1171 /* Write config in file */ 1170 /* Write config in file */
1172 flexrm_write_config_in_seqfile(mbox, file); 1171 flexrm_write_config_in_seqfile(mbox, file);
@@ -1176,8 +1175,7 @@ static int flexrm_debugfs_conf_show(struct seq_file *file, void *offset)
1176 1175
1177static int flexrm_debugfs_stats_show(struct seq_file *file, void *offset) 1176static int flexrm_debugfs_stats_show(struct seq_file *file, void *offset)
1178{ 1177{
1179 struct platform_device *pdev = to_platform_device(file->private); 1178 struct flexrm_mbox *mbox = dev_get_drvdata(file->private);
1180 struct flexrm_mbox *mbox = platform_get_drvdata(pdev);
1181 1179
1182 /* Write stats in file */ 1180 /* Write stats in file */
1183 flexrm_write_stats_in_seqfile(mbox, file); 1181 flexrm_write_stats_in_seqfile(mbox, file);