Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2515355pxb; Sun, 23 Jan 2022 07:08:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzC3j2qKJPw7ZqLQFSawP3UuuRfa0hmYj9UjdK0pMU3babteH/PKrifUjWkrGsmOatg/WQC X-Received: by 2002:a17:90b:164e:: with SMTP id il14mr2516604pjb.84.1642950514670; Sun, 23 Jan 2022 07:08:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1642950514; cv=pass; d=google.com; s=arc-20160816; b=zoKEuX6Ts4Trm6xsRmZRC4WTOrjRwJKNOiuhtm/ansVYA1e94tM7dOaA9FdocPnYxF LqTZiETMw0ujIi8pDLSESsBpNO+yp1BaNUOfv2e2+l6JZOpbsKq1TxegTlZfMpz5TkJ0 +ed3NKNIzGKCcHg7+l3B2o35veqqbnm4XAL9cqioL8+imx1Yf8VJTPa2/Zw4H3/hLFc6 4wOc6kltVMKUSIfEDNdFsgtYp1uOEfZBHXIdrBGTGT0AcDKkkQ5HANK69FhAznYcBtrZ aEAs5RFd1204WySalCIRpI8Xzzi0Mb7pA6nXyXUPyNH4dFXEF1pveAIurRv4yXNIOYUD EL5g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=11qrQckzhIflZAPjqm044Qyn1W2pRpQsw8fCA76lbIw=; b=DdEyC0d3QZ+D3wXjDh3O4x7zluDUramdcZo53Es1ocSc62cz1qDSIGAk+KNS4atawj lA0g0Vv/eVWdOWUCwy/7QYFBd7jmqQQTARm2VfXisA3ELrhKke7Z8FDRC0M09fqSs4Ms 29I6rJbvdB41Tb0dO6TU50xvsZJ7SgBOVsspeasRjghzAdT8XXELBTOmq7gbw1UAvtQK ysrFr8W7jmDhcVFirjgzrRjV4REZenTbDjkOJ/KT0wHN+1DdSNeaDwI0UgCbRh88w5Ci MFbLJa4hMinhcXDgk0Om2tdKRnzf8PFuwg0h/1tWOdpaKatTjKJ2cFhJD7tWYOEhOoRR ZL7g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=BdQqF0le; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x28si373814pfr.265.2022.01.23.07.08.22; Sun, 23 Jan 2022 07:08:34 -0800 (PST) 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=@Nvidia.com header.s=selector2 header.b=BdQqF0le; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231491AbiAVLdj (ORCPT + 99 others); Sat, 22 Jan 2022 06:33:39 -0500 Received: from mail-bn7nam10on2078.outbound.protection.outlook.com ([40.107.92.78]:2589 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234457AbiAVLdh (ORCPT ); Sat, 22 Jan 2022 06:33:37 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QjKAXTfbVVD96PMW2mB2EbOyNp16U6bFV1L6oqarYhBObfnulgyhqC3hOT4YbcWjsOKfzA6NBNAjaRp2vkHGH8k4KCk2PUehlgghFVNR00s8JUyFd2kbbTVG2tHKOHezfl+HbDc5MdS85jJzbqS22LPdhmoSMjxkq2y1S9dx/Hv3JyjB28ksfW5w2Qm+LdKutkCXOFhSauumXNlqASF5lCIkhr49Z5lpdEfsKrlLuTuniAC0TOrGLPC61p3DThBtm4GoxiitBlGpoG4hSV+YnRnQu/6GfwwSQdkk9nktybjnLIOCcqdVs/SNtDjTTfk52ApRVN/ZnJGQOhJHg5G3yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=11qrQckzhIflZAPjqm044Qyn1W2pRpQsw8fCA76lbIw=; b=BQdHTun5d88Kn/ca+piUD4+w/BoQYoHjS61KMdoawsjAd5OkRWXaEGPsSyR0mCa29qd3TyWSri3wz7SCNEptfRFYODXZjXUENmTK9Nzx51TnPCuf53Bv/vNJ8sKFSAQoNIRoYgDX0uMrG18GDsNDfclIcKi0QHier8oIwA6E2wsdUckznKhdyKEEfoCRGSYFmYdZDXYldbcARxJsXnW3OtdZcvrEIUvUN3gI/C+qDaxed10ZfwSC3puyM1Vsx1vVsnDvyBfjPmVWAIulMrnherAJPSgNe7ehAFF4RDPnpI4KZO5xPTHyd6V/I8mKWbKGDVk0RzinYkJaU7EuJIt0hA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) smtp.rcpttodomain=linuxfoundation.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=11qrQckzhIflZAPjqm044Qyn1W2pRpQsw8fCA76lbIw=; b=BdQqF0lev07fCKBa7HDxlDYzd6CmGtCS2T+bQ8HFJ2gfY5curPxHV9UinXdJTHYVVHgmH+kiiIS+meWeSEQkJiS2aWJW+Srh3UxvbFkRs+lgUKjJ2FO0wpeYk2dDJTTLd0ZFNRf1d8BhZtENLzpbkTsdzZ5sMbfcyk9n4J93J8136A2JXbqZCtw0uQBB92g5ulw7V5XZa2J1shpV2S98ts9/HB9dc+KtaYBIp+jzuDMgT5aiifXsS+ywFxRHtlSsxV16ewDpY8MlggGVFU6WJSlbpro89fJ9oCOV677Hu3ctmf0NVInhcqNVIRdcIGFUNXOX3EV9bMfougDyiZDADA== Received: from CO2PR06CA0065.namprd06.prod.outlook.com (2603:10b6:104:3::23) by DM6PR12MB3642.namprd12.prod.outlook.com (2603:10b6:5:11f::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.12; Sat, 22 Jan 2022 11:33:35 +0000 Received: from CO1NAM11FT016.eop-nam11.prod.protection.outlook.com (2603:10b6:104:3:cafe::99) by CO2PR06CA0065.outlook.office365.com (2603:10b6:104:3::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.8 via Frontend Transport; Sat, 22 Jan 2022 11:33:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.238) by CO1NAM11FT016.mail.protection.outlook.com (10.13.175.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4909.7 via Frontend Transport; Sat, 22 Jan 2022 11:33:34 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sat, 22 Jan 2022 11:33:33 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Sat, 22 Jan 2022 03:33:32 -0800 Received: from kyarlagadda-linux.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.986.9 via Frontend Transport; Sat, 22 Jan 2022 03:33:28 -0800 From: Akhil R To: , , , , , , , , , , , , , , , CC: Subject: [PATCH v4 3/3] i2c: smbus: Use device_*() functions instead of of_*() Date: Sat, 22 Jan 2022 17:02:46 +0530 Message-ID: <1642851166-27096-4-git-send-email-akhilrajeev@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1642851166-27096-1-git-send-email-akhilrajeev@nvidia.com> References: <1642851166-27096-1-git-send-email-akhilrajeev@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 159b8330-2e91-4018-58f8-08d9dd9b0697 X-MS-TrafficTypeDiagnostic: DM6PR12MB3642:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PyjYT01/jusPqKI0Lnab9AGTZ+eLR2Xb4E/SJyTMl3kqu18WqEhmrGAk5IklUVmORRc7pPghw+h+9nS7ANtrH90zbZawZUPmQo6I+mOueByV6l1OHCBm4xbiIAUzXBxQodYYnmeMqV1TdYL7yC8UvTezGBG6U67PfksDlji9mZEQA4fCbCR6K+pLsoCg86ztcDQPwT/6J0HamZodqU8cTHsXxuFGH8lOljhkEsUs47fsp8OlebAMULRRoUCSWspz4L3y9NuXWLK2CsG3Hcp8LfUo5TN/zuusesnpP7svNnx4VV6M9dDOd/c8aTwszgNJS1l+bWb6NkV85fZ+4Z4LJRn8gVkwtlUWXB5HZl2K8Sj/DAAluva4jlpQQBxgTEzr8oh0pe07PT6c8gNg9OdoC/9oofIzTANOEYxwyGarKEd4hgqheYbu718J5FGaCoTSLtuh2nzgF3OvlmYs6DC0C1sXApp1swuknSdxfKLyp2QfX3qM9tu2UrysubBcRQqv6x2rMsZKTR/Elu1wZT7XAkQW7lhcEGRwafoYi4lDgQb6F+uTAv3dtP8wkNi6EPNkMtVsrFh6LFcYuKlYANGoc5m9wxohdleXa7aA+yPYGssrKSKmp/sMYtXy/CjDNTxFmQ7bq5qlNf/3r/FuspOpdQMlZXcuGd893bFpKWxhbdCk4PEedG0XiR3j01vWyVx4ALDjOyhRTEhQ1Sxi/qZuh+jt/em6Tc1ZzycVTZ3OE82SuBZATACgFi/nQNqwfdJ+O1zqAQErF02+DX5NNorkpKLT6HkVxhUhf03NMovQsdDXNdoqauQmOjrJIAhSkmL/BY81tdo+6TZWDJSGbI8BH9MyWrJDOMYDK+2E1YeGmuQ= X-Forefront-Antispam-Report: CIP:12.22.5.238;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:mail.nvidia.com;PTR:InfoNoRecords;CAT:NONE;SFS:(4636009)(40470700004)(36840700001)(46966006)(82310400004)(316002)(4326008)(336012)(5660300002)(107886003)(40460700003)(8936002)(2906002)(81166007)(356005)(26005)(508600001)(70206006)(70586007)(6666004)(110136005)(186003)(7416002)(426003)(36756003)(83380400001)(2616005)(7696005)(36860700001)(47076005)(921005)(8676002)(86362001)(83996005)(36900700001)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jan 2022 11:33:34.8637 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 159b8330-2e91-4018-58f8-08d9dd9b0697 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[12.22.5.238];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT016.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3642 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Change of_*() functions to device_*() for firmware agnostic usage. This allows to have the smbus_alert interrupt without any changes in the controller drivers using the ACPI table. Signed-off-by: Akhil R Reviewed-by: Andy Shevchenko --- drivers/i2c/i2c-core-base.c | 2 +- drivers/i2c/i2c-core-smbus.c | 10 +++++----- drivers/i2c/i2c-smbus.c | 3 ++- include/linux/i2c-smbus.h | 6 +++--- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 2c59dd7..32a4526 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -1479,7 +1479,7 @@ static int i2c_register_adapter(struct i2c_adapter *adap) goto out_list; } - res = of_i2c_setup_smbus_alert(adap); + res = i2c_setup_smbus_alert(adap); if (res) goto out_reg; diff --git a/drivers/i2c/i2c-core-smbus.c b/drivers/i2c/i2c-core-smbus.c index e5b2d14..4c24c84 100644 --- a/drivers/i2c/i2c-core-smbus.c +++ b/drivers/i2c/i2c-core-smbus.c @@ -701,13 +701,13 @@ struct i2c_client *i2c_new_smbus_alert_device(struct i2c_adapter *adapter, } EXPORT_SYMBOL_GPL(i2c_new_smbus_alert_device); -#if IS_ENABLED(CONFIG_I2C_SMBUS) && IS_ENABLED(CONFIG_OF) -int of_i2c_setup_smbus_alert(struct i2c_adapter *adapter) +#if IS_ENABLED(CONFIG_I2C_SMBUS) +int i2c_setup_smbus_alert(struct i2c_adapter *adapter) { int irq; - irq = of_property_match_string(adapter->dev.of_node, "interrupt-names", - "smbus_alert"); + irq = device_property_match_string(adapter->dev.parent, "interrupt-names", + "smbus_alert"); if (irq == -EINVAL || irq == -ENODATA) return 0; else if (irq < 0) @@ -715,5 +715,5 @@ int of_i2c_setup_smbus_alert(struct i2c_adapter *adapter) return PTR_ERR_OR_ZERO(i2c_new_smbus_alert_device(adapter, NULL)); } -EXPORT_SYMBOL_GPL(of_i2c_setup_smbus_alert); +EXPORT_SYMBOL_GPL(i2c_setup_smbus_alert); #endif diff --git a/drivers/i2c/i2c-smbus.c b/drivers/i2c/i2c-smbus.c index d3d06e3..026e2355 100644 --- a/drivers/i2c/i2c-smbus.c +++ b/drivers/i2c/i2c-smbus.c @@ -128,7 +128,8 @@ static int smbalert_probe(struct i2c_client *ara, if (setup) { irq = setup->irq; } else { - irq = of_irq_get_byname(adapter->dev.of_node, "smbus_alert"); + irq = fwnode_irq_get_byname(dev_fwnode(adapter->dev.parent), + "smbus_alert"); if (irq <= 0) return irq; } diff --git a/include/linux/i2c-smbus.h b/include/linux/i2c-smbus.h index 1ef4218..95cf902 100644 --- a/include/linux/i2c-smbus.h +++ b/include/linux/i2c-smbus.h @@ -30,10 +30,10 @@ struct i2c_client *i2c_new_smbus_alert_device(struct i2c_adapter *adapter, struct i2c_smbus_alert_setup *setup); int i2c_handle_smbus_alert(struct i2c_client *ara); -#if IS_ENABLED(CONFIG_I2C_SMBUS) && IS_ENABLED(CONFIG_OF) -int of_i2c_setup_smbus_alert(struct i2c_adapter *adap); +#if IS_ENABLED(CONFIG_I2C_SMBUS) +int i2c_setup_smbus_alert(struct i2c_adapter *adap); #else -static inline int of_i2c_setup_smbus_alert(struct i2c_adapter *adap) +static inline int i2c_setup_smbus_alert(struct i2c_adapter *adap) { return 0; } -- 2.7.4