Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933967AbZKYBNN (ORCPT ); Tue, 24 Nov 2009 20:13:13 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933914AbZKYBNM (ORCPT ); Tue, 24 Nov 2009 20:13:12 -0500 Received: from relais.videotron.ca ([24.201.245.36]:53269 "EHLO relais.videotron.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933891AbZKYBNL (ORCPT ); Tue, 24 Nov 2009 20:13:11 -0500 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: TEXT/PLAIN; charset=US-ASCII Date: Tue, 24 Nov 2009 20:13:15 -0500 (EST) From: Nicolas Pitre X-X-Sender: nico@xanadu.home To: Kevin Hilman Cc: "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] NET: smc91x: convert to dev_pm_ops In-reply-to: <1259103467-31016-1-git-send-email-khilman@deeprootsystems.com> Message-id: References: <1259103467-31016-1-git-send-email-khilman@deeprootsystems.com> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2251 Lines: 74 On Tue, 24 Nov 2009, Kevin Hilman wrote: > Convert smc91x driver from legacy PM hooks over to using dev_pm_ops. > > Tested on OMAP3 platform. > > Signed-off-by: Kevin Hilman Acked-by: Nicolas Pitre > --- > drivers/net/smc91x.c | 18 ++++++++++++------ > 1 files changed, 12 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c > index 05c91ee..8e4c455 100644 > --- a/drivers/net/smc91x.c > +++ b/drivers/net/smc91x.c > @@ -2365,9 +2365,10 @@ static int __devexit smc_drv_remove(struct platform_device *pdev) > return 0; > } > > -static int smc_drv_suspend(struct platform_device *dev, pm_message_t state) > +static int smc_drv_suspend(struct device *dev) > { > - struct net_device *ndev = platform_get_drvdata(dev); > + struct platform_device *pdev = to_platform_device(dev); > + struct net_device *ndev = platform_get_drvdata(pdev); > > if (ndev) { > if (netif_running(ndev)) { > @@ -2379,9 +2380,10 @@ static int smc_drv_suspend(struct platform_device *dev, pm_message_t state) > return 0; > } > > -static int smc_drv_resume(struct platform_device *dev) > +static int smc_drv_resume(struct device *dev) > { > - struct net_device *ndev = platform_get_drvdata(dev); > + struct platform_device *pdev = to_platform_device(dev); > + struct net_device *ndev = platform_get_drvdata(pdev); > > if (ndev) { > struct smc_local *lp = netdev_priv(ndev); > @@ -2397,14 +2399,18 @@ static int smc_drv_resume(struct platform_device *dev) > return 0; > } > > +static struct dev_pm_ops smc_drv_pm_ops = { > + .suspend = smc_drv_suspend, > + .resume = smc_drv_resume, > +}; > + > static struct platform_driver smc_driver = { > .probe = smc_drv_probe, > .remove = __devexit_p(smc_drv_remove), > - .suspend = smc_drv_suspend, > - .resume = smc_drv_resume, > .driver = { > .name = CARDNAME, > .owner = THIS_MODULE, > + .pm = &smc_drv_pm_ops, > }, > }; > > -- > 1.6.5.1 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/