lkml.org 
[lkml]   [2018]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 42/61] ptp: simplify getting .drvdata
    Date
    We should get drvdata from struct device directly. Going via
    platform_device is an unneeded step back and forth.

    Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
    ---

    Build tested only. buildbot is happy. Please apply individually.

    drivers/ptp/ptp_dte.c | 6 ++----
    1 file changed, 2 insertions(+), 4 deletions(-)

    diff --git a/drivers/ptp/ptp_dte.c b/drivers/ptp/ptp_dte.c
    index 6edd3b9c7f01..5481a27d4fec 100644
    --- a/drivers/ptp/ptp_dte.c
    +++ b/drivers/ptp/ptp_dte.c
    @@ -287,8 +287,7 @@ static int ptp_dte_remove(struct platform_device *pdev)
    #ifdef CONFIG_PM_SLEEP
    static int ptp_dte_suspend(struct device *dev)
    {
    - struct platform_device *pdev = to_platform_device(dev);
    - struct ptp_dte *ptp_dte = platform_get_drvdata(pdev);
    + struct ptp_dte *ptp_dte = dev_get_drvdata(dev);
    u8 i;

    for (i = 0; i < DTE_NUM_REGS_TO_RESTORE; i++) {
    @@ -304,8 +303,7 @@ static int ptp_dte_suspend(struct device *dev)

    static int ptp_dte_resume(struct device *dev)
    {
    - struct platform_device *pdev = to_platform_device(dev);
    - struct ptp_dte *ptp_dte = platform_get_drvdata(pdev);
    + struct ptp_dte *ptp_dte = dev_get_drvdata(dev);
    u8 i;

    for (i = 0; i < DTE_NUM_REGS_TO_RESTORE; i++) {
    --
    2.11.0
    \
     
     \ /
      Last update: 2018-04-19 16:14    [W:4.021 / U:0.128 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site