Commit 7836922d authored by Fuqian Huang's avatar Fuqian Huang Committed by Jassi Brar

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: default avatarFuqian Huang <huangfq.daxian@gmail.com>
Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
parent 11108f46
...@@ -1165,8 +1165,7 @@ static int flexrm_process_completions(struct flexrm_ring *ring) ...@@ -1165,8 +1165,7 @@ static int flexrm_process_completions(struct flexrm_ring *ring)
static int flexrm_debugfs_conf_show(struct seq_file *file, void *offset) static int flexrm_debugfs_conf_show(struct seq_file *file, void *offset)
{ {
struct platform_device *pdev = to_platform_device(file->private); struct flexrm_mbox *mbox = dev_get_drvdata(file->private);
struct flexrm_mbox *mbox = platform_get_drvdata(pdev);
/* Write config in file */ /* Write config in file */
flexrm_write_config_in_seqfile(mbox, file); flexrm_write_config_in_seqfile(mbox, file);
...@@ -1176,8 +1175,7 @@ static int flexrm_debugfs_conf_show(struct seq_file *file, void *offset) ...@@ -1176,8 +1175,7 @@ static int flexrm_debugfs_conf_show(struct seq_file *file, void *offset)
static int flexrm_debugfs_stats_show(struct seq_file *file, void *offset) static int flexrm_debugfs_stats_show(struct seq_file *file, void *offset)
{ {
struct platform_device *pdev = to_platform_device(file->private); struct flexrm_mbox *mbox = dev_get_drvdata(file->private);
struct flexrm_mbox *mbox = platform_get_drvdata(pdev);
/* Write stats in file */ /* Write stats in file */
flexrm_write_stats_in_seqfile(mbox, file); flexrm_write_stats_in_seqfile(mbox, file);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment