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), }, }; From patchwork Tue Jul 26 09:59:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 12929117 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 42425C43334 for ; Tue, 26 Jul 2022 09:58:44 +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:References:In-Reply-To: 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: List-Owner; bh=Pe1OZlmAoTmzbhGADTGMxXovo3euWo62mBwJce1CERM=; b=0ozVLOy/dodxOh YogT2Pv2xwajsW9XZIXECCXu+s0vXv1bjR4eVwuywMCdJ7lLGtDKJiaayJacIDOa3Kzsla4mVWIdM ctIKju4R2HJlb/uBJIlJQpW0+1w9StmdiPQBpR0d7BzCVc4DR+2+JJwMrFAZjMzEuzVEsVSrK4zEU VPrDkZbce3EsmCzzHyADSUoXqz9jHIo6+DXaLjsldiUuIdlJ0L8UbqMCPL9qaxTgyo0aj0jZXxcYN 01G+yTeydK3cDzq44tFhCvf1XxDZ0dRrvQI9Ned91ZefTiGVeK2SMWkSez2I6TuPyZzBUTqy3WKgJ zwrL3kMZRJoBvwwzuGAw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oGHK2-00C17b-Dr; Tue, 26 Jul 2022 09:57:50 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oGHJj-00C0vJ-N0 for linux-arm-kernel@lists.infradead.org; Tue, 26 Jul 2022 09:57:33 +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:in-reply-to: references:mime-version:content-transfer-encoding; bh=JG/ERXhf6xiKqQVd9uEykEdvGxS/Vz7RRikpu9AWpDE=; b=e8Q2al9e7nTbmFaFMXfgcnyMYdJkS63GYGhkkX+u4Ey6x8xh60Ap9TIR 8QKpmzROyXaPSKtoYVPIh2Qj290j9OZO3IX3T0Lx3ZGFACtsxv8L5aNaN 9K0UP8YyfPE5Q6qOwFrFngEasLx1T6tcSCpWQrNDv5Z7JL1oPnrbqAgW5 wZg1NldTiY5G9ayXW41wGlV1FZ3pkel5YWjKObQkzPKOt2sFcLbLSt6dP tDVUFWO2ulc5qRbLRAeDnNR84kfADJ20BmKfBmkz2/YFZXG/kSWQHkpO2 mO1DWMuYpHAEI22XJaQW3E8eDtMBRMMB5UBiZ7t2dZqSSvRpzrq/7wJEr g==; X-IronPort-AV: E=Sophos;i="5.93,193,1654585200"; d="scan'208";a="166409646" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 26 Jul 2022 02:57:30 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Tue, 26 Jul 2022 02:57:30 -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:28 -0700 From: Claudiu Beznea To: , , , , CC: , , , Claudiu Beznea Subject: [PATCH 2/2] usb: gadget: udc: atmel: remove #ifdef CONFIG_PM_SLEEP Date: Tue, 26 Jul 2022 12:59:48 +0300 Message-ID: <20220726095948.1809038-2-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220726095948.1809038-1-claudiu.beznea@microchip.com> References: <20220726095948.1809038-1-claudiu.beznea@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220726_025731_853252_ED4A0928 X-CRM114-Status: GOOD ( 10.91 ) 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 Remove #ifdef CONFIG_PM_SLEEP and use DEFINE_SIMPLE_DEV_PM_OPS() along with pm_sleep_ptr(). Signed-off-by: Claudiu Beznea --- drivers/usb/gadget/udc/atmel_usba_udc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index ae2bfbac603e..6c088f6e9afa 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -2384,7 +2384,6 @@ static int usba_udc_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP static int usba_udc_suspend(struct device *dev) { struct usba_udc *udc = dev_get_drvdata(dev); @@ -2442,15 +2441,14 @@ static int usba_udc_resume(struct device *dev) return 0; } -#endif -static SIMPLE_DEV_PM_OPS(usba_udc_pm_ops, usba_udc_suspend, usba_udc_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(usba_udc_pm_ops, usba_udc_suspend, usba_udc_resume); static struct platform_driver udc_driver = { .remove = usba_udc_remove, .driver = { .name = "atmel_usba_udc", - .pm = &usba_udc_pm_ops, + .pm = pm_sleep_ptr(&usba_udc_pm_ops), .of_match_table = atmel_udc_dt_ids, }, };