Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1685444rdb; Thu, 7 Dec 2023 06:18:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IFIVJKNEHw5UIDajdIu9J176Ay/3QfdB0gdSwWZn0TJgD/rppXJTHuj8vpXAln1CvT7ueir X-Received: by 2002:a17:903:2309:b0:1d0:c7c6:91a6 with SMTP id d9-20020a170903230900b001d0c7c691a6mr2505049plh.112.1701958725381; Thu, 07 Dec 2023 06:18:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701958725; cv=none; d=google.com; s=arc-20160816; b=VHYCORDs+JN+Hq8ixLFwF2yFCyyhzHMdB/8wmxSDX80D1DgNwzb3m3/R2O7Oz1vHRM 9EYLJEPhITRIsNzaq50eq99XG0zOdC4JW0kmofUCmt7Ev6FhWJ8PbeBex5slhZg6J55j s6Fwi3UMLHuhnZskVnHbs4nX2etTr8vJh8z4zrnYX7fzSfc+p+5Ywzf6UMjxLysmTMyI HoW8xXZgb8mlN/CVnCr23OIQzeljT9ZI8XIfK2FTgGaovJuM1PiSJGh5ramcFBwD7FZR dWU1gsncBZTHaluYz2pWA/HJIqpvHRzIDHbtbCCMTRds4a9/cmt3Mpu+xWDhF0urZHMN aOwQ== 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=vHqphr8GqzlSyLFd9FKvZs758aNbW24s1gNdMu0uUPY=; fh=2EyuYZuFv7pvbWODgXyYvSVo1Jt/nOD9U4n59BuOM5Q=; b=zPBoXn5BLiBoM/o9WcHsA71Oym6TwtElrwd8z1Kcjtmtrkj330c8iODqTlkh7cb6ab lPMioohN7UUEiyDhMOJFmeud+rm/hhgp9U4Q/50HKpzQNEGTp1dvR1JNDfCnYbldandM XM4hvB1pzQ0ibY0d9LxvZxWHMTFbUNLU7UDIdlTOwftoW+G6hBrL4GxbLeVeVw7Sc+FI Aro+mF8lqYgMMBx3TGbHK8f4Q+PP4kND0eRPuQdso5/bTSUFMYJqWhUX99jfQyO0i5pk t0LnBLZdDCotvtO9h3n8aaTeoPDm1BJbZeh+YfsYelVFeFTGuiltdJJUUlOgLCruH1aC sBEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OPwmwa61; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id t6-20020a17090abc4600b00286f3fe9e84si1169420pjv.45.2023.12.07.06.18.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 06:18:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OPwmwa61; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 9D2EA80B7C2E; Thu, 7 Dec 2023 06:18:39 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443227AbjLGORr (ORCPT + 99 others); Thu, 7 Dec 2023 09:17:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443214AbjLGORR (ORCPT ); Thu, 7 Dec 2023 09:17:17 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98D171716; Thu, 7 Dec 2023 06:17:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701958636; x=1733494636; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yamRjBTHlJZZ2xEb7LSBV/GouU3u82Ilx8RqV32Sls4=; b=OPwmwa61U5wFZnr6dBlkvlNuxjlvqxobJnVmi9hQ7ygMkWVtZmnvsFLT V9RodP7RwVMRyl76LT/aJqgrUaYyJ1nD2kxFoj9X9Esr0nz/nHX/Laleu T88aPlN62cGZMPaL/GbZqzx+UVzki1VZvLWA/zWdZB0/N18bYLHFxcPRV nT30CHaxEAg+JARMKjpkdGEw5b6QLeHTO3K/tppb2aPWo0IabShabvOVj WYnrY263BbeXIuZ0+iVIvJVsBCmfb8Qm2sHGke2d3BC2NlfKh9XMHYGDQ zRg8aOYf5iW/7UYmCx7v3wMqqQLhtl63F2Xppc49CItXUX9Mf79yMkz28 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10917"; a="460726159" X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="460726159" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2023 06:17:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10917"; a="889756096" X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="889756096" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 07 Dec 2023 06:17:10 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 2C00ABAB; Thu, 7 Dec 2023 16:17:03 +0200 (EET) From: Andy Shevchenko To: Mario Limonciello , Jarkko Nikula , Herbert Xu , Andy Shevchenko , Wolfram Sang , Andi Shyti , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mika Westerberg , Jan Dabros , Philipp Zabel , Serge Semin Subject: [PATCH v5 15/24] i2c: designware: Unify the firmware type checks Date: Thu, 7 Dec 2023 16:13:55 +0200 Message-ID: <20231207141653.2785124-16-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231207141653.2785124-1-andriy.shevchenko@linux.intel.com> References: <20231207141653.2785124-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 agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 07 Dec 2023 06:18:39 -0800 (PST) Instead of asymmetrical checks for the firmware type use the is_*_node() calls. Reviewed-by: Andi Shyti Reviewed-by: Mario Limonciello Tested-by: Serge Semin Acked-by: Jarkko Nikula Link: https://lore.kernel.org/r/20231120144641.1660574-16-andriy.shevchenko@linux.intel.com 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