Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp596791pxb; Thu, 9 Sep 2021 07:53:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKadn3KGge7c0WGQGMrKf8rCpMqyQOfXUuMb2xIB35oPpSaJFPYbwq7FEYdiHNaoT3Of8B X-Received: by 2002:a02:7355:: with SMTP id a21mr176949jae.53.1631199204290; Thu, 09 Sep 2021 07:53:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631199204; cv=none; d=google.com; s=arc-20160816; b=lomHf8UytwhKgsncn6tn10DrEZG59c4FZbGMaX5V8ByjXwoYRLI23VZ5Zj/XKx+flr jLWXyrscv8kN43S8APNPM8Iidv0GyQdR7k7Zm2cAjL0d21zwdsBIuwleu5A+7rBhaiJx IT637Zh3t7sVxe7EkKrPuFLxvLcrgw7ZPYyYAHCwWubD00fkMhLGugHv18tMaAek7fM7 zWbZYVlWHO4zJmTxyrJpHWtiJ3FJOokkBC441a/HqaKJT/QiF4C9TTcDTevw/wkl1pKY 0z+5vf2og3wRXOTYoPByDJNg98yg1+sHXWldYCLcmeimOCF0rKmKlKdiDaw3jLQaX02k NODg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=JHiuE2OiEXe434H1xcWuo0fgF0pvMhHeANpuYRG86uk=; b=cYIDKFVvo94NtZ6LRpW5cQXa9nke56cRvFmYdY0AFD5R8ZggWJz3Zjy0E8lMiD4rsw PajI2ytyIuChxrCxHjHx90oNBpzI3pCEGhomf1k6ebFsu77nIltm81Jd2s0r5/6jeGNj xVxWrifhhkGjTytAogaXdsOa3nhXtgBppY1OlFj0MHpqBgzB5DKDknbufnekL9lU7Rig aTDMPn54oDcSJ8rfKoMto33T7Fy9QK2Y/U6AHQCh1bIbnrA4KD8yc1i/2aQzdSo7mLt0 uV5hpYbmMu/HO7fCkYmDuN/m72rNXwMHa4eEyHbeTaDfeektHeBxOLnsI8Rt0nbC/eI7 zaog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TJZR5fyj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v15si1764310jal.73.2021.09.09.07.53.08; Thu, 09 Sep 2021 07:53:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TJZR5fyj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236344AbhIIOwT (ORCPT + 99 others); Thu, 9 Sep 2021 10:52:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236615AbhIIOwR (ORCPT ); Thu, 9 Sep 2021 10:52:17 -0400 Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61A49C061575 for ; Thu, 9 Sep 2021 07:51:08 -0700 (PDT) Received: by mail-ot1-x335.google.com with SMTP id c19-20020a9d6153000000b0051829acbfc7so2780831otk.9 for ; Thu, 09 Sep 2021 07:51:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JHiuE2OiEXe434H1xcWuo0fgF0pvMhHeANpuYRG86uk=; b=TJZR5fyjjKCP6sE6kBKth3oqDI5bvePDlzAtu3WZ/DUz8oxFyLNKUc+8ldEWbsB20m VjMZNdVvacpdvJtxqP5++lHldHQVQjqaNyR+YXw0b1DFKtQcSQE3JKNs/sZLX3sWNp7k FCyYZVkz37NfwGvmi0J19R1aK4CUzn9QKipk6gVo14kDzhPmIGm66ElWNyDUrazoPfsN Pag04bnAIk0i4fBikT79Z5WJTSQrYkB+LaLHNg6hvKgX45T/Wy5r2jBp26huJcbpR5g5 /YXT8PsaW6C/RenNWjhbfMrYQON/pu8onVPkQoy8S7LGrcN7P6cHEBiUyFtLuftedf1E k4YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JHiuE2OiEXe434H1xcWuo0fgF0pvMhHeANpuYRG86uk=; b=UhBjDdJY1lN/egJZb5IC9mGpqK8ZYifLUQ3lVkGIrEfdU1AKNz9zSwEW66WFX+UZPY XbDoUvT8GfHyb0kIJmOXRefpaSom+xrMmrz2LaruzEOegq1Y7v1ZBAnaTlG95K6R8kkR QC81mxLyE8ZzP4npMorILy7JmRicDtvUuHDYIUXPyTW4V3ZAwdpPhiBp/hPSEcm97aRN A6xyAFzTiUI7MDp4gHXPbs3Dz5Ee66xyaVEWMIlcLw6fd6k9owJAts+YGV7SbuoSf//L iLThYVawwOpU6/sfhemR/2JJogk2pkshODf1+5cEE+RXcxoUMxyTHHMHu5xBPMuWkRcK wOYg== X-Gm-Message-State: AOAM532fdOjKPjYuNXpu9EEM6qNncL57r+Bh+M70codL8NRaxu2L3kCZ J9oQtj4hXS21J+iUMUU98TsPIU2HMySDHLtXpFIPhqYTGB8= X-Received: by 2002:a9d:17c5:: with SMTP id j63mr231177otj.208.1631199067794; Thu, 09 Sep 2021 07:51:07 -0700 (PDT) MIME-Version: 1.0 References: <20210907025940.1535-1-caihuoqing@baidu.com> In-Reply-To: <20210907025940.1535-1-caihuoqing@baidu.com> From: Ulf Hansson Date: Thu, 9 Sep 2021 16:50:31 +0200 Message-ID: Subject: Re: [PATCH v2] mmc: omap_hsmmc: Make use of the helper macro SET_RUNTIME_PM_OPS() To: Cai Huoqing Cc: linux-mmc , linux-omap , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 7 Sept 2021 at 04:59, Cai Huoqing wrote: > > Use the helper macro SET_RUNTIME_PM_OPS() instead of the verbose > operators ".runtime_suspend/.runtime_resume", because the > SET_RUNTIME_PM_OPS() is a nice helper macro that could be brought > in to make code a little more concise. > > Signed-off-by: Cai Huoqing Queued for v5.16 on the temporary devel branch, thanks! Kind regards Uffe > --- > v1->v2: *Add "#ifdef CONFIG_PM" around runtime_suspend|resume(). > *Remove the unused implementation of omap_hsmmc_context_restore() > > drivers/mmc/host/omap_hsmmc.c | 10 +++------- > 1 file changed, 3 insertions(+), 7 deletions(-) > > diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c > index 2f8038d69f67..7a29ad542e4a 100644 > --- a/drivers/mmc/host/omap_hsmmc.c > +++ b/drivers/mmc/host/omap_hsmmc.c > @@ -702,11 +702,6 @@ static void omap_hsmmc_context_save(struct omap_hsmmc_host *host) > > #else > > -static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host) > -{ > - return 0; > -} > - > static void omap_hsmmc_context_save(struct omap_hsmmc_host *host) > { > } > @@ -2086,6 +2081,7 @@ static int omap_hsmmc_resume(struct device *dev) > } > #endif > > +#ifdef CONFIG_PM > static int omap_hsmmc_runtime_suspend(struct device *dev) > { > struct omap_hsmmc_host *host; > @@ -2153,11 +2149,11 @@ static int omap_hsmmc_runtime_resume(struct device *dev) > spin_unlock_irqrestore(&host->irq_lock, flags); > return 0; > } > +#endif > > static const struct dev_pm_ops omap_hsmmc_dev_pm_ops = { > SET_SYSTEM_SLEEP_PM_OPS(omap_hsmmc_suspend, omap_hsmmc_resume) > - .runtime_suspend = omap_hsmmc_runtime_suspend, > - .runtime_resume = omap_hsmmc_runtime_resume, > + SET_RUNTIME_PM_OPS(omap_hsmmc_runtime_suspend, omap_hsmmc_runtime_resume, NULL) > }; > > static struct platform_driver omap_hsmmc_driver = { > -- > 2.25.1 >