Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3865956imm; Mon, 6 Aug 2018 11:57:11 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdD+7aQ0amRftW4h1tFYKxxVKPP9KnfhtODPK9pEbcyAclFPAYln7GI2h5q9LQQki11t1o3 X-Received: by 2002:a62:23c2:: with SMTP id q63-v6mr18282348pfj.91.1533581830939; Mon, 06 Aug 2018 11:57:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533581830; cv=none; d=google.com; s=arc-20160816; b=oQNAPODr0gLj4s74AU6mn3CUqoWxHPJgP26gD8dqs90tmT6xzrKYRJidXjRH8EJUDK x9ZfWiFZQs3mD3KPzgCi8F7hmKAVGYbAHnTV/Yb3ZXGFtaZ50wqZ+/S1JFVRpgH0vCfM +Cak0CiLPU5Ax0o3omNV3gP30sjJN7v9i/lfyA+vfw+6sVnyWK00biinAIuo3NDElDMu 639kraridIRTg/hilVYFSDugad+MooFPrjICbc5DmIqfEJ4CdSpDJXAirmSUTGrPOd6u Tp+iMZsxvVrfAM0YWE00/Ioyrppgyj5y6sU8qMIVhm9bIwjTHoWaWIrLieYlkiopnyFh iUtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=AfeZd/Iewp2PCCcm021fhvmNM0Gun1KiWqlRpk2/wq4=; b=ZEfmZoAifBPnzI1Ay2sHM1dp2+VTpQP4gDGj1rYoW72CN5tiknb5P3GWVP+EOAmbBv S0MdJotVMohxg6VtfnyZISC2txQBBFC4yQCbH+ZvsI/XB42B801Sm7/vkApB1WvaKEAV +07KEAexNlLWeqamFtS5AEEu659Wu48jvMvokiPHgH0ZPnx4KrdwH7jpwy3uwIG3v53V lCpLmIhZVytOXGa4YJEzvT4Sd7qiHuKKY+6wvwWg/u/qLwCrnfdTXcfd/9UGEe2IuQjy ryMGKNlxj+nb1grYhRDaQAX3Cw7F9RcNjJAZm45yoJ+jFB+cdzF6kAOxM1rQyPrCrJ91 Y7GQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e36-v6si12362391pge.507.2018.08.06.11.56.56; Mon, 06 Aug 2018 11:57:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732746AbeHFVEn (ORCPT + 99 others); Mon, 6 Aug 2018 17:04:43 -0400 Received: from mail.bootlin.com ([62.4.15.54]:37122 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728936AbeHFVEm (ORCPT ); Mon, 6 Aug 2018 17:04:42 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 62CED207B7; Mon, 6 Aug 2018 20:54:14 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LPuteaux-656-1-243-71.w82-127.abo.wanadoo.fr [82.127.120.71]) by mail.bootlin.com (Postfix) with ESMTPSA id 217492072D; Mon, 6 Aug 2018 20:54:14 +0200 (CEST) From: Alexandre Belloni To: Wolfram Sang , Jarkko Nikula , James Hogan Cc: Paul Burton , Andy Shevchenko , Mika Westerberg , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org, Thomas Petazzoni , Allan Nielsen , Alexandre Belloni Subject: [PATCH v3 1/6] i2c: designware: use generic table matching Date: Mon, 6 Aug 2018 20:54:07 +0200 Message-Id: <20180806185412.7210-2-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180806185412.7210-1-alexandre.belloni@bootlin.com> References: <20180806185412.7210-1-alexandre.belloni@bootlin.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Switch to device_get_match_data in probe to match the device specific data instead of using the acpi specific function. Suggested-by: Andy Shevchenko Signed-off-by: Alexandre Belloni --- Changes in v3: - removed unused variable - switched to uintptr_t for the cast drivers/i2c/busses/i2c-designware-platdrv.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index ddf13527aaee..d117c120730d 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -86,7 +86,6 @@ static int dw_i2c_acpi_configure(struct platform_device *pdev) struct i2c_timings *t = &dev->timings; u32 ss_ht = 0, fp_ht = 0, hs_ht = 0, fs_ht = 0; acpi_handle handle = ACPI_HANDLE(&pdev->dev); - const struct acpi_device_id *id; struct acpi_device *adev; const char *uid; @@ -119,10 +118,6 @@ static int dw_i2c_acpi_configure(struct platform_device *pdev) break; } - id = acpi_match_device(pdev->dev.driver->acpi_match_table, &pdev->dev); - if (id && id->driver_data) - dev->flags |= (u32)id->driver_data; - if (acpi_bus_get_device(handle, &adev)) return -ENODEV; @@ -291,6 +286,8 @@ static int dw_i2c_plat_probe(struct platform_device *pdev) else t->bus_freq_hz = 400000; + dev->flags |= (uintptr_t)device_get_match_data(&pdev->dev); + if (has_acpi_companion(&pdev->dev)) dw_i2c_acpi_configure(pdev); -- 2.18.0