Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20D95C433F5 for ; Thu, 18 Nov 2021 09:36:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F139861B5F for ; Thu, 18 Nov 2021 09:36:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245199AbhKRJjO (ORCPT ); Thu, 18 Nov 2021 04:39:14 -0500 Received: from mail-eopbgr10109.outbound.protection.outlook.com ([40.107.1.109]:5159 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S245187AbhKRJjG (ORCPT ); Thu, 18 Nov 2021 04:39:06 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ld37CIS25E1NMN7XbKa6SvnCVylHF6YWjS3SKw1x+ig5ZnAtRTu5EENIZjpJ6oZ0jZeY+QQa5DX8wRhwvJrV3RgXgnP94IF9SIF1+fvx1I6LvsA873WXyQkfgo9KdDdY1ZL/mZjE/GU/kdTQCacOiWtKZ9LfB57ndfh2B4x5uNAHVhXb7YvXaRd+u/bSre4JQ/jqET07DSCBdpYVGXUd0XNdNEXm0EB9SEyinQhYr0r/OfFXwHirfKcDIESyrCnuwxLopTz/w9QVKDpgY2mgDLtI+oSCVVSWUyYEkAsfcFraW+mmauVnMRasrCHXLjmIHT0FxwjH02f6bsOBCDTZmw== 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=7qEsqsocf4PzwIdC6Xxb618bbHZITyXaKJ6wgrfxCAQ=; b=TTLoeFGY0fOC9ify2u5/yzfjyZ4Zjsp1hVNNTMoYEvY9Oy76tX8mNSFL46mWjnjPGYTHUfgvq3gS5Q8jnTf/G1WqoVlJ7lTyFbRkepmlX3z3IdIpKjVXYFkBf+DmSTuYr74rpr5Xp0EpaMVh1tRNbd/L3et2qXk4BwDkZIYSxocHhMO6Be1l2OLzbpGunUkCh0AvPC1uYR8tnUjmmQ+wZSP7l3g9BuJh/AiakYrKFEhKdK1r6dVL0JwBSCR1EymKFykBs6NDlwUdSAJvVQzeqVsgwCXR9gflN9X/QFE38V4EenRW0+8sxEE743hWlamjvUiSLUg/IegakDm0tR8x8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=axentia.se; dmarc=pass action=none header.from=axentia.se; dkim=pass header.d=axentia.se; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axentia.se; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7qEsqsocf4PzwIdC6Xxb618bbHZITyXaKJ6wgrfxCAQ=; b=ljhndUSLJ0DJhlkU/VCKuOYpNW2JyuY5VgTGBPwCtmo28A1lS/XK29tguU3EY0fiCYmb+++8XanFMVEeG8Lqlr5oFfpALIk5GvGo+JX+OUTF1yDZh3Cg0ZPNUK1kXdDnd9F/oR2zXOpD3OGmmYURMdk82MvR0wrtp4V78CjnOcM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=axentia.se; Received: from DB8PR02MB5482.eurprd02.prod.outlook.com (2603:10a6:10:eb::29) by DB9PR02MB6508.eurprd02.prod.outlook.com (2603:10a6:10:21d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Thu, 18 Nov 2021 09:36:04 +0000 Received: from DB8PR02MB5482.eurprd02.prod.outlook.com ([fe80::b1d6:d448:8d63:5683]) by DB8PR02MB5482.eurprd02.prod.outlook.com ([fe80::b1d6:d448:8d63:5683%6]) with mapi id 15.20.4690.027; Thu, 18 Nov 2021 09:36:03 +0000 Message-ID: <304efdfe-db6e-051e-b61d-e73a8dfa1c53@axentia.se> Date: Thu, 18 Nov 2021 10:36:00 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: =?UTF-8?B?UmU6IFtQQVRDSCB2MSAxLzNdIGkyYzogbXV4OiBncGlvOsKgUmVwbGFj?= =?UTF-8?Q?e_custom_acpi=5fget=5flocal=5faddress=28=29?= Content-Language: en-US To: Andy Shevchenko , Evan Green , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Peter Korsgaard References: <20211115154201.46579-1-andriy.shevchenko@linux.intel.com> From: Peter Rosin Organization: Axentia Technologies AB In-Reply-To: <20211115154201.46579-1-andriy.shevchenko@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: GV3P280CA0042.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:9::34) To DB8PR02MB5482.eurprd02.prod.outlook.com (2603:10a6:10:eb::29) MIME-Version: 1.0 Received: from [192.168.13.3] (185.178.140.238) by GV3P280CA0042.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:9::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19 via Frontend Transport; Thu, 18 Nov 2021 09:36:02 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 21759298-3d35-4405-6304-08d9aa76d679 X-MS-TrafficTypeDiagnostic: DB9PR02MB6508: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:935; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mQjUjNO91oyOWT7GmDxQYPE7vZZ+IkAIb1pf1PDuJGE82IZNm1yY6VBMMywGkt+Uuvl90HOopwFPGBajVpwcEhXq5C/jpk3qm4w7U0Qz8mCaDwo5GIfx6htgcakAQWdKAEqWTG/sQY+E++yKE+vXsENG35fq1y8AzThDPPYGYE2AyycH5kRnKHFXq1YjcZP1W83qC8m8N25YrtFxKfgoImK0muqwsUS5g1zewKvCk52tWoCGU7ca6EUr8SEpJ6X9Gm6rPra3keTUisxVmwHkXJIlUCq60fuIHC/+D4geptIChvq0Dq7Qu40PkJgTqvKG7Sdncc4+25cFTGAWObFVSOLxtgVlscwt2dJsgBgd4Fi5gsrzx74BzRzJrcYm8OVMkekQrOwnY6BD8fvodIGTljxP/tYL8P69IXz31GKU1lRG7hPB62fQZww8SR0XeVY23ZdFhb2HOOPM0ZiCuZGfFfZA44sqb0mcv27tuaN7i/vfMUTrlKCiVgUSemyq6+3E4U9UDMjokWcGrIazRtuTh+LIk+KMDnVENr5hc2gk9XcDFw4HZjBSQ631ObZnInd3/TMdKmNXfOJgqhnrNRQZgu2NnM83swatsWtOCYTqR6hwuP/+TsXJcJmDh9EyZgWcCL+n6JeY77Mb+VGqaL8hHM7HeriFwvZ40HITsysqEaf/JxBiK/CJ4mahWxP198D+qSexULjbNvRXQZcKPpu8Bk1lR4hbyls7ObMFcsAro7U= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB8PR02MB5482.eurprd02.prod.outlook.com;PTR:;CAT:NONE;SFS:(346002)(376002)(396003)(39840400004)(136003)(366004)(186003)(4001150100001)(26005)(86362001)(31696002)(6486002)(36916002)(2906002)(36756003)(38100700002)(83380400001)(66556008)(53546011)(31686004)(5660300002)(66946007)(66476007)(316002)(16576012)(2616005)(956004)(110136005)(4326008)(508600001)(8936002)(45980500001)(43740500002);DIR:OUT;SFP:1102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dQWWcrdGNjMW1rVHp5?= =?utf-8?B?cUEzWmpRQTF3cGUvMURTc01aTW85S2JYMHBEdmM1TEdKUUdoV09DVSsyZHlu?= =?utf-8?B?MjNMM3llMFdURWpxdmJST2RXZEZVQkU5Rlp2REFxYzdJZk9VYmJFdG5iT2VS?= =?utf-8?B?UHJENEZ1OEVGMkRBY0YzbzNHTytCcDlKaE5CS3pFMkhmRnp6WG1CNTJZTEhM?= =?utf-8?B?Q0RFeklLcDZ3TWV3YTlPR2NLU3ZZOStsdnZOK2x1WHh1U3VTbWdoeGtTWHpU?= =?utf-8?B?Zy8yOFRQSGZWbngwSis1dW9XNGdOWXE3VnNWa3RDUG8wUnNuRk9QTHlGMGlP?= =?utf-8?B?VDA5bUY2czJqSk9jQjQ3ZS9tdEFnL3pBeVAyM1ZYQzZhVFJLbFhzRW9YZWxt?= =?utf-8?Q?XuPY=3D?= X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-Network-Message-Id: 21759298-3d35-4405-6304-08d9aa76d679 X-MS-Exchange-CrossTenant-AuthSource: DB8PR02MB5482.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Nov 2021 09:36:03.3266 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4ee68585-03e1-4785-942a-df9c1871a234 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WEPIEwYLWUuZpzmbesIufnYwVrQHAtGHdxEoTg0LcE6aSLmYoF33sXOsNfthjMR7 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR02MB6508 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! On 2021-11-15 16:41, Andy Shevchenko wrote: > Recently ACPI gained the acpi_get_local_address() API which may be used > instead of home grown i2c_mux_gpio_get_acpi_adr(). > > Signed-off-by: Andy Shevchenko > --- > drivers/i2c/muxes/i2c-mux-gpio.c | 43 ++------------------------------ > 1 file changed, 2 insertions(+), 41 deletions(-) > > diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b/drivers/i2c/muxes/i2c-mux-gpio.c > index bac415a52b78..31e6eb1591bb 100644 > --- a/drivers/i2c/muxes/i2c-mux-gpio.c > +++ b/drivers/i2c/muxes/i2c-mux-gpio.c > @@ -49,45 +49,6 @@ static int i2c_mux_gpio_deselect(struct i2c_mux_core *muxc, u32 chan) > return 0; > } > > -#ifdef CONFIG_ACPI > - > -static int i2c_mux_gpio_get_acpi_adr(struct device *dev, > - struct fwnode_handle *fwdev, > - unsigned int *adr) > - > -{ > - unsigned long long adr64; > - acpi_status status; > - > - status = acpi_evaluate_integer(ACPI_HANDLE_FWNODE(fwdev), > - METHOD_NAME__ADR, > - NULL, &adr64); > - > - if (!ACPI_SUCCESS(status)) { > - dev_err(dev, "Cannot get address\n"); > - return -EINVAL; > - } > - > - *adr = adr64; > - if (*adr != adr64) { > - dev_err(dev, "Address out of range\n"); > - return -ERANGE; > - } In the conversion, I read it as if we lose this overflow check. Why is that not a problem? Cheers, Peter > - > - return 0; > -} > - > -#else > - > -static int i2c_mux_gpio_get_acpi_adr(struct device *dev, > - struct fwnode_handle *fwdev, > - unsigned int *adr) > -{ > - return -EINVAL; > -} > - > -#endif > - > static int i2c_mux_gpio_probe_fw(struct gpiomux *mux, > struct platform_device *pdev) > { > @@ -141,9 +102,9 @@ static int i2c_mux_gpio_probe_fw(struct gpiomux *mux, > fwnode_property_read_u32(child, "reg", values + i); > > } else if (is_acpi_node(child)) { > - rc = i2c_mux_gpio_get_acpi_adr(dev, child, values + i); > + rc = acpi_get_local_address(ACPI_HANDLE_FWNODE(child), values + i); > if (rc) > - return rc; > + return dev_err_probe(dev, rc, "Cannot get address\n"); > } > > i++; >