From patchwork Tue Apr 13 14:37:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 420420 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0596CC433ED for ; Tue, 13 Apr 2021 14:37:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D2612613B3 for ; Tue, 13 Apr 2021 14:37:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243346AbhDMOiP (ORCPT ); Tue, 13 Apr 2021 10:38:15 -0400 Received: from mga12.intel.com ([192.55.52.136]:44168 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237179AbhDMOiO (ORCPT ); Tue, 13 Apr 2021 10:38:14 -0400 IronPort-SDR: KcxiDkliPBYEPvhe5aOXgkKJjLBTxT0iwt1JwUJpwIuHYLZJ78Le7PfK69zqtF3mK3Bjx+GAcC OmyNEs3a7Jyw== X-IronPort-AV: E=McAfee;i="6200,9189,9953"; a="173919058" X-IronPort-AV: E=Sophos;i="5.82,219,1613462400"; d="scan'208";a="173919058" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2021 07:37:54 -0700 IronPort-SDR: hikAh/u1PLSUJ5UU7CKgkyX3XGxkCv7m2pl4ZasOWQr6mFUS11V+wM07v3M80smkoI35REla1z 7qNTHxOXfM0w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,219,1613462400"; d="scan'208";a="417878777" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 13 Apr 2021 07:37:52 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 4D29612A; Tue, 13 Apr 2021 17:38:09 +0300 (EEST) From: Andy Shevchenko To: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Chris Packham , wsa@kernel.org, Andy Shevchenko Subject: [PATCH v1 2/4] i2c: mpc: Remove CONFIG_PM_SLEEP ifdeffery Date: Tue, 13 Apr 2021 17:37:54 +0300 Message-Id: <20210413143756.60138-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210413143756.60138-1-andriy.shevchenko@linux.intel.com> References: <20210413143756.60138-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Use __maybe_unused for the suspend()/resume() hooks and get rid of the CONFIG_PM_SLEEP ifdeffery to improve the code. Signed-off-by: Andy Shevchenko --- drivers/i2c/busses/i2c-mpc.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index 6dc029a31d36..2376accd4e8e 100644 --- a/drivers/i2c/busses/i2c-mpc.c +++ b/drivers/i2c/busses/i2c-mpc.c @@ -66,9 +66,7 @@ struct mpc_i2c { struct i2c_adapter adap; int irq; u32 real_clk; -#ifdef CONFIG_PM_SLEEP u8 fdr, dfsrr; -#endif struct clk *clk_per; }; @@ -761,8 +759,7 @@ static int fsl_i2c_remove(struct platform_device *op) return 0; }; -#ifdef CONFIG_PM_SLEEP -static int mpc_i2c_suspend(struct device *dev) +static int __maybe_unused mpc_i2c_suspend(struct device *dev) { struct mpc_i2c *i2c = dev_get_drvdata(dev); @@ -772,7 +769,7 @@ static int mpc_i2c_suspend(struct device *dev) return 0; } -static int mpc_i2c_resume(struct device *dev) +static int __maybe_unused mpc_i2c_resume(struct device *dev) { struct mpc_i2c *i2c = dev_get_drvdata(dev); @@ -781,12 +778,7 @@ static int mpc_i2c_resume(struct device *dev) return 0; } - static SIMPLE_DEV_PM_OPS(mpc_i2c_pm_ops, mpc_i2c_suspend, mpc_i2c_resume); -#define MPC_I2C_PM_OPS (&mpc_i2c_pm_ops) -#else -#define MPC_I2C_PM_OPS NULL -#endif static const struct mpc_i2c_data mpc_i2c_data_512x = { .setup = mpc_i2c_setup_512x, From patchwork Tue Apr 13 14:37:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 420419 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEDE2C433B4 for ; Tue, 13 Apr 2021 14:38:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BEF10613AB for ; Tue, 13 Apr 2021 14:38:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245105AbhDMOi2 (ORCPT ); Tue, 13 Apr 2021 10:38:28 -0400 Received: from mga06.intel.com ([134.134.136.31]:59450 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244991AbhDMOiT (ORCPT ); Tue, 13 Apr 2021 10:38:19 -0400 IronPort-SDR: fDA6/xiaxQMceKuRm6JOY7vYdDct9tkQoU725znyw97O8oQWgJzLp/vEA00RTt6hInoZ2HUG33 apIvbqnIbrpw== X-IronPort-AV: E=McAfee;i="6200,9189,9953"; a="255745416" X-IronPort-AV: E=Sophos;i="5.82,219,1613462400"; d="scan'208";a="255745416" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2021 07:37:59 -0700 IronPort-SDR: apJb53K3B22MdPpvtvmVTJ06AXnv8IF3da2FrqSac9ZzV2+S3VoIAZ7oS8OL0kLmv7Yub3PijZ vBxb0oUF3iDA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,219,1613462400"; d="scan'208";a="521618605" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 13 Apr 2021 07:37:54 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 4E53A17E; Tue, 13 Apr 2021 17:38:10 +0300 (EEST) From: Andy Shevchenko To: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Chris Packham , wsa@kernel.org, Andy Shevchenko Subject: [PATCH v1 4/4] i2c: mpc: Drop duplicate message from devm_platform_ioremap_resource() Date: Tue, 13 Apr 2021 17:37:56 +0300 Message-Id: <20210413143756.60138-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210413143756.60138-1-andriy.shevchenko@linux.intel.com> References: <20210413143756.60138-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org devm_platform_ioremap_resource() prints a message in case of error. Drop custom one. Signed-off-by: Andy Shevchenko Reviewed-by: Chris Packham --- drivers/i2c/busses/i2c-mpc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index ec9d7d93e80f..684a8cd17efd 100644 --- a/drivers/i2c/busses/i2c-mpc.c +++ b/drivers/i2c/busses/i2c-mpc.c @@ -664,10 +664,8 @@ static int fsl_i2c_probe(struct platform_device *op) init_waitqueue_head(&i2c->queue); i2c->base = devm_platform_ioremap_resource(op, 0); - if (IS_ERR(i2c->base)) { - dev_err(i2c->dev, "failed to map controller\n"); + if (IS_ERR(i2c->base)) return PTR_ERR(i2c->base); - } i2c->irq = platform_get_irq(op, 0); if (i2c->irq < 0)