Skip to content

Commit

Permalink
drivers/rtc/rtc-m48t86.c: use dev_get_platdata()
Browse files Browse the repository at this point in the history
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.  This is a cosmetic change to make
the code simpler and enhance the readability.

Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Jingoo Han authored and torvalds committed Nov 13, 2013
1 parent 8136032 commit b5f0902
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/rtc/rtc-m48t86.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static int m48t86_rtc_read_time(struct device *dev, struct rtc_time *tm)
{
unsigned char reg;
struct platform_device *pdev = to_platform_device(dev);
struct m48t86_ops *ops = pdev->dev.platform_data;
struct m48t86_ops *ops = dev_get_platdata(&pdev->dev);

reg = ops->readbyte(M48T86_REG_B);

Expand Down Expand Up @@ -84,7 +84,7 @@ static int m48t86_rtc_set_time(struct device *dev, struct rtc_time *tm)
{
unsigned char reg;
struct platform_device *pdev = to_platform_device(dev);
struct m48t86_ops *ops = pdev->dev.platform_data;
struct m48t86_ops *ops = dev_get_platdata(&pdev->dev);

reg = ops->readbyte(M48T86_REG_B);

Expand Down Expand Up @@ -123,7 +123,7 @@ static int m48t86_rtc_proc(struct device *dev, struct seq_file *seq)
{
unsigned char reg;
struct platform_device *pdev = to_platform_device(dev);
struct m48t86_ops *ops = pdev->dev.platform_data;
struct m48t86_ops *ops = dev_get_platdata(&pdev->dev);

reg = ops->readbyte(M48T86_REG_B);

Expand All @@ -147,7 +147,7 @@ static const struct rtc_class_ops m48t86_rtc_ops = {
static int m48t86_rtc_probe(struct platform_device *dev)
{
unsigned char reg;
struct m48t86_ops *ops = dev->dev.platform_data;
struct m48t86_ops *ops = dev_get_platdata(&dev->dev);
struct rtc_device *rtc;

rtc = devm_rtc_device_register(&dev->dev, "m48t86",
Expand Down

0 comments on commit b5f0902

Please sign in to comment.