Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2270628rdb; Mon, 20 Nov 2023 06:50:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IH8gdqbqP0vUU4u62Qmk/TFAg1ofOeIoGlft/zlnk39ogyxzz0L3SliOLjRZPRZLUMQFpfz X-Received: by 2002:a17:90b:4c08:b0:27d:1571:f683 with SMTP id na8-20020a17090b4c0800b0027d1571f683mr4962027pjb.44.1700491811627; Mon, 20 Nov 2023 06:50:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700491811; cv=none; d=google.com; s=arc-20160816; b=uX4nrgsde1q0UXt3rEAYwLXmKtTEm5Pe63lmo21HErYdRh3ojhy3Wcb+u+wMcSTDsh oRfhXCzvSHw9Z+5aIQ08TnLXoZSTREbwXiZW07NDXUan8v4MM2WyPFMJsI4rNUyz3Cu9 /G40TMAch7COHa8nKDBeKxFe+AYGCYJavKtN5dS7k39DgGQyeIemhR99B548NzgvJ50Z pSqNtrW6SOZIwfqcjdUEeCNL4aLyk/KgYSa3ZG0KATbvSjPB6oTLGYd4ykVWGc5CXA4B gxki3U/9bj3URRfNDLmZoBJG1yCa9zsyZH5OK+xQzAbMyHFEha4UEmASzbxfXjlhBMox k11g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=S+UY1TfX1Frf4HKUjhkcnIkPJ3jmG8mKjp2HafKNkYo=; fh=g3amdiifXhwL/mTWljo4oOX/iLvH3RCBC8SWsJqOWek=; b=zARGu9Vxz1SWXUbgSBmxv8bPnf5SxJozJpLFZ+aujWe/odvnQR+Xb8GeFz3hao3tpt CKN1D7Wk8Yfx1Sq/GU+bsvALCBEAmcaOwQ/2Ih/RSZh1YXZMVFNrEEJeZh4vwTgvEEA5 F2pLtlLQJkmnynyQwQQNXJFsMDa+qfnVaxkz4OrNR+ETqJkTEmwdH7Eh/p15TWv6DPIL zS58FJoAwTpzzU2IWYmbZaaKR33UIHogaimlpvTiJulBTMLcCmdh0VmEPmogN+9pI226 3hLX/a6Hq+sT7Xzx2AGCDEsdidOcObnQYPqwtXMDEhbo/gcgUoophgQwAAqzXPEIJXXh xYYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Ma6yvUUF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id gc5-20020a17090b310500b00280294ec225si10251346pjb.24.2023.11.20.06.50.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 06:50:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Ma6yvUUF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 1F44280A9DE0; Mon, 20 Nov 2023 06:49:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234005AbjKTOre (ORCPT + 99 others); Mon, 20 Nov 2023 09:47:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233837AbjKTOrF (ORCPT ); Mon, 20 Nov 2023 09:47:05 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D100D4D; Mon, 20 Nov 2023 06:46:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700491617; x=1732027617; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mWnrCbe952qZv1cdRW5+nJoDJDChwK0VNgu5M+CVVe8=; b=Ma6yvUUFxOc5hswOn0EoW04i+KwE30SfweummFWecKd++fxSDo1rnE2p ZwGLo8M9gH0f2ksQPNDmw2YLhG8Mff90vMG6hg0chdrA4sgeeKTYf9LNw 6JPKN7a0vAc8OnoqqBaaqTroi82aVtZjEToD4chbND7T6RBgvKvvshEAv JykvI7pTssUcyGQdTvjuGelnF09hfZ8jKEXrLEOf6923y4qKopnsvdu+w uBEwFmSWBS+qXszenmSjrXp73lD0/bZsEX+rDzcBEQinKZEgu2LPsvTjD J49RSs3Z8fgJOlgWNr0cxeY68cGs60XJ8z0vJfsWLQiK8aMa2EjXtBpTt w==; X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="382017054" X-IronPort-AV: E=Sophos;i="6.04,214,1695711600"; d="scan'208";a="382017054" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2023 06:46:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="832291652" X-IronPort-AV: E=Sophos;i="6.04,214,1695711600"; d="scan'208";a="832291652" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 20 Nov 2023 06:46:53 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id D47AA516; Mon, 20 Nov 2023 16:46:44 +0200 (EET) From: Andy Shevchenko To: Mario Limonciello , Jarkko Nikula , Herbert Xu , Andy Shevchenko , Wolfram Sang , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mika Westerberg , Jan Dabros , Andi Shyti , Philipp Zabel Subject: [PATCH v4 15/24] i2c: designware: Unify the firmware type checks Date: Mon, 20 Nov 2023 16:41:57 +0200 Message-ID: <20231120144641.1660574-16-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231120144641.1660574-1-andriy.shevchenko@linux.intel.com> References: <20231120144641.1660574-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 20 Nov 2023 06:49:53 -0800 (PST) Instead of asymmetrical checks for the firmware type use the is_*_node() calls. Reviewed-by: Andi Shyti Reviewed-by: Mario Limonciello Signed-off-by: Andy Shevchenko --- drivers/i2c/busses/i2c-designware-common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-common.c b/drivers/i2c/busses/i2c-designware-common.c index d3ddfec46200..fb75e9b3d4fc 100644 --- a/drivers/i2c/busses/i2c-designware-common.c +++ b/drivers/i2c/busses/i2c-designware-common.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -372,14 +373,15 @@ int i2c_dw_fw_parse_and_configure(struct dw_i2c_dev *dev) { struct i2c_timings *t = &dev->timings; struct device *device = dev->dev; + struct fwnode_handle *fwnode = dev_fwnode(device); i2c_parse_fw_timings(device, t, false); i2c_dw_adjust_bus_speed(dev); - if (device->of_node) + if (is_of_node(fwnode)) i2c_dw_of_configure(device); - if (has_acpi_companion(device)) + else if (is_acpi_node(fwnode)) i2c_dw_acpi_configure(device); return i2c_dw_validate_speed(dev); -- 2.43.0.rc1.1.gbec44491f096