From patchwork Tue Jul 26 09:59:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 12929116 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BC27DC433EF for ; Tue, 26 Jul 2022 09:58:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ObtJ+804IkHdZmr5dKrtbWLdFfOk48ioYlMHUrC+MLE=; b=gDnRlIUu8n4ooP JpOBEENb034IaHN1/TK5RD+iDvAuFSJxI1kKiJtGe98kGjEyVqnmsywCFCxzqbmZtyTO4Bo01hC76 ZyzXlakRsClEQc8UQM5BCOAaFiupxawKBphufSK3nTju3RAKniuxYgtp3NdXnwQViRWwOxEEaEmwu xmf0hI8HzTkL/tzw3wTEbRqxQoKODuI0qB+Uac6oQVGhK3yY12Q6Nqq0jzf4bvJY7Wj49kmnUH9mi ZW5XqoNmyWfjtHO7JY5nULoUrjGCVPHtiqHitNBqug+zhOp+W1poOHiHsBPvq6X1LGqbU2e93OrPD OGWDSQKRKZkDFBbSx7lQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oGHJp-00C100-UE; Tue, 26 Jul 2022 09:57:38 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oGHJi-00C0uI-Ab for linux-arm-kernel@lists.infradead.org; Tue, 26 Jul 2022 09:57:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1658829451; x=1690365451; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=i8ZzEPCPV1l7drUm54+sPDrEsQsrRaUXcWuEJ9BPPeU=; b=AwisSHLO1iGXJkaYgSB31EbZPeMCJhHsRhH3M6w9GOyunMqWfdHJRc9B 6MnubYoZbAnyfQjU/MpzJTCXnKViGTGZgOmOcbr8WRlKOy08eB43JB9P4 /FrV1xeruvYSmgZvua/1Fs+h7JreLWzWCdrTBA4px5y6fptUXCPBT9fcG OQ14xeJVu92C/r+5gEkUxkhFVg7lBaopltRdgA2K244FCz9QmnUoSjk+/ lfUr5DkFPdTs+zKreAxSWPWqKV9wcHsjZONuULFwrbrPORoUwjxvDLjT2 c2U5CtDsKF6wl9yZ5xlSawdf9QlbnsPxyOG/ktC/Lo6gnyWufbWg+P2Pb Q==; X-IronPort-AV: E=Sophos;i="5.93,193,1654585200"; d="scan'208";a="173652709" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 26 Jul 2022 02:57:29 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Tue, 26 Jul 2022 02:57:28 -0700 Received: from localhost.localdomain (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Tue, 26 Jul 2022 02:57:25 -0700 From: Claudiu Beznea To: , , , , CC: , , , Claudiu Beznea Subject: [PATCH 1/2] usb: gadget: at91_udc: stop using legacy pm ops Date: Tue, 26 Jul 2022 12:59:47 +0300 Message-ID: <20220726095948.1809038-1-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220726_025730_477077_32C4B706 X-CRM114-Status: GOOD ( 11.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Stop using legacy PM ops and switch using dev_pm_ops. Signed-off-by: Claudiu Beznea --- drivers/usb/gadget/udc/at91_udc.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/usb/gadget/udc/at91_udc.c b/drivers/usb/gadget/udc/at91_udc.c index 728987280373..2f522f77c553 100644 --- a/drivers/usb/gadget/udc/at91_udc.c +++ b/drivers/usb/gadget/udc/at91_udc.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -1948,11 +1949,10 @@ static int at91udc_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM -static int at91udc_suspend(struct platform_device *pdev, pm_message_t mesg) +static int at91udc_suspend(struct device *dev) { - struct at91_udc *udc = platform_get_drvdata(pdev); - int wake = udc->driver && device_may_wakeup(&pdev->dev); + struct at91_udc *udc = dev_get_drvdata(dev); + int wake = udc->driver && device_may_wakeup(dev); unsigned long flags; /* Unless we can act normally to the host (letting it wake us up @@ -1976,9 +1976,9 @@ static int at91udc_suspend(struct platform_device *pdev, pm_message_t mesg) return 0; } -static int at91udc_resume(struct platform_device *pdev) +static int at91udc_resume(struct device *dev) { - struct at91_udc *udc = platform_get_drvdata(pdev); + struct at91_udc *udc = dev_get_drvdata(dev); unsigned long flags; if (udc->board.vbus_pin && !udc->board.vbus_polled && @@ -1995,19 +1995,17 @@ static int at91udc_resume(struct platform_device *pdev) } return 0; } -#else -#define at91udc_suspend NULL -#define at91udc_resume NULL -#endif + +static DEFINE_SIMPLE_DEV_PM_OPS(at91_udc_pm_ops, at91udc_suspend, + at91udc_resume); static struct platform_driver at91_udc_driver = { .remove = at91udc_remove, .shutdown = at91udc_shutdown, - .suspend = at91udc_suspend, - .resume = at91udc_resume, .driver = { .name = driver_name, .of_match_table = at91_udc_dt_ids, + .pm = pm_ptr(&at91_udc_pm_ops), }, };