From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= Subject: Re: [PATCH v3 4/4] net: nb8800: Add support for suspend/resume Date: Tue, 14 Nov 2017 13:02:32 +0000 Message-ID: References: <230165aa-eaf1-6e2b-7ff3-45b3ee4ffc62@sigmadesigns.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT Cc: David Miller , netdev , Linux ARM , Florian Fainelli , Thibaud Cornic , Mason To: Marc Gonzalez Return-path: Received: from unicorn.mansr.com ([81.2.72.234]:52302 "EHLO unicorn.mansr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754495AbdKNNCd (ORCPT ); Tue, 14 Nov 2017 08:02:33 -0500 In-Reply-To: (Marc Gonzalez's message of "Tue, 14 Nov 2017 13:04:25 +0100") Sender: netdev-owner@vger.kernel.org List-ID: Marc Gonzalez writes: > Signed-off-by: Marc Gonzalez Missing patch description. Don't bother though. I won't approve of this implementation. Suspend support has to depend on the chip since the EMAC core doesn't have anything of the kind. > --- > drivers/net/ethernet/aurora/nb8800.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/drivers/net/ethernet/aurora/nb8800.c b/drivers/net/ethernet/aurora/nb8800.c > index b71d8fb80610..9af2423aed03 100644 > --- a/drivers/net/ethernet/aurora/nb8800.c > +++ b/drivers/net/ethernet/aurora/nb8800.c > @@ -1437,6 +1437,26 @@ static int nb8800_remove(struct platform_device *pdev) > return 0; > } > > +static int nb8800_suspend(struct platform_device *pdev, pm_message_t state) > +{ > + struct net_device *dev = platform_get_drvdata(pdev); > + > + if (netif_running(dev)) > + return nb8800_stop(dev); > + > + return 0; > +} > + > +static int nb8800_resume(struct platform_device *pdev) > +{ > + struct net_device *dev = platform_get_drvdata(pdev); > + > + if (netif_running(dev)) > + return nb8800_open(dev); > + > + return 0; > +} > + > static struct platform_driver nb8800_driver = { > .driver = { > .name = "nb8800", > @@ -1444,6 +1464,8 @@ static struct platform_driver nb8800_driver = { > }, > .probe = nb8800_probe, > .remove = nb8800_remove, > + .suspend = nb8800_suspend, > + .resume = nb8800_resume, > }; > > module_platform_driver(nb8800_driver); > -- > 2.15.0 > -- Måns Rullgård