From patchwork Tue Jan 19 00:31:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 366465 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3553C433E0 for ; Tue, 19 Jan 2021 00:35:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AD9AD230FF for ; Tue, 19 Jan 2021 00:35:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732448AbhASAe4 (ORCPT ); Mon, 18 Jan 2021 19:34:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730466AbhASAez (ORCPT ); Mon, 18 Jan 2021 19:34:55 -0500 Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93B19C061573 for ; Mon, 18 Jan 2021 16:34:15 -0800 (PST) Received: by mail-qt1-x82f.google.com with SMTP id h19so12579162qtq.13 for ; Mon, 18 Jan 2021 16:34:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=IaB0DFhzc/5KDrNFZumai2eiYNxkTar/KQWukG/PG5U=; b=IcTVK1c10DY9BGIQUQC1x4LUd2C+idra0A9DsvXu/lnLB5jbSm+rLxCxOV/Bt4VAUK l4b9QBqXViRV6g7E5OghqwObMMoIsDoVPkoSwXyFKsWM74fXi1JtKdm20oaEYUn6lci8 +d2i6P9TIU0miKTFuew0iSLmQoRlLTd/JvPgKXdqFOIQ1Q6QBPIOiwsrdgDD2Jsj1MY/ YE3BjLlHKwTFUKXRw3f53XkE4fmb0vm+v76Le4NR7qPVbupkkR7UwAfeHPB9KTb5V51D dxa0UvKRNRtVP6Ps17CjY/fD8gwcncm+ba5oYAk3S12U+K5EJAu0LdLAc4/8omG94gKQ QIPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=IaB0DFhzc/5KDrNFZumai2eiYNxkTar/KQWukG/PG5U=; b=LxVSkkCpe/gTKbI7Mh1pAtT3YKAJXIU75Bu/T6r5doIWARr3WKZIqFwKwHBvnNT6zu Jb9iBev7int/KqH8TK9+kWVOOF+dCQlsR8B3CH12rexT2hQCN0abexwq5t77dCb7T0+X qu/r/kNfB4hfdsyeBJ4GyC6eebe+hJU2gYdY4AUPBGDgKlVuiCG/0E16JDhkqb6p6e/M 1nFRUdEfHEFXKnAf3kEdmC33+5PuB9IMvV9teVQYlQIkRpjUtJRkFl4kPRqyDQzU8wax YobONHN9ykNK3+KM0b4KcEo689XHmjfUtrB/zvSbOfl1xpC2NbqpgrUJkO/cSNEYRw5y BSMw== X-Gm-Message-State: AOAM532aGLrraqSWu9fMNS8fC8ktSVNF/0HX/5e0iua5x9o4qj0AwDmG /ljpYG0hfM7Lx78s6nVgQ4Y= X-Google-Smtp-Source: ABdhPJz0A1wdQ4mmg15zm7gAl2ZWv0pUjD162qMXI6G+hTEme27e5w8h5TWIx3uQTUBwWop9A1qLbw== X-Received: by 2002:ac8:4c99:: with SMTP id j25mr2119437qtv.390.1611016454710; Mon, 18 Jan 2021 16:34:14 -0800 (PST) Received: from localhost.localdomain ([177.194.79.136]) by smtp.gmail.com with ESMTPSA id r15sm11791050qke.55.2021.01.18.16.34.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jan 2021 16:34:13 -0800 (PST) From: Fabio Estevam To: linux@rempel-privat.de Cc: linux-i2c@vger.kernel.org, kernel@pengutronix.de, wsa@kernel.org, Fabio Estevam Subject: [PATCH] i2c: imx: Remove unused .id_table support Date: Mon, 18 Jan 2021 21:31:47 -0300 Message-Id: <20210119003148.1793614-1-festevam@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Since 5.10-rc1 i.MX is a devicetree-only platform and the existing .id_table support in this driver was only useful for old non-devicetree platforms. Signed-off-by: Fabio Estevam --- drivers/i2c/busses/i2c-imx.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index c98529c76348..ebf66120c51e 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -233,19 +233,6 @@ static struct imx_i2c_hwdata vf610_i2c_hwdata = { }; -static const struct platform_device_id imx_i2c_devtype[] = { - { - .name = "imx1-i2c", - .driver_data = (kernel_ulong_t)&imx1_i2c_hwdata, - }, { - .name = "imx21-i2c", - .driver_data = (kernel_ulong_t)&imx21_i2c_hwdata, - }, { - /* sentinel */ - } -}; -MODULE_DEVICE_TABLE(platform, imx_i2c_devtype); - static const struct of_device_id i2c_imx_dt_ids[] = { { .compatible = "fsl,imx1-i2c", .data = &imx1_i2c_hwdata, }, { .compatible = "fsl,imx21-i2c", .data = &imx21_i2c_hwdata, }, @@ -1141,11 +1128,7 @@ static int i2c_imx_probe(struct platform_device *pdev) return -ENOMEM; match = device_get_match_data(&pdev->dev); - if (match) - i2c_imx->hwdata = match; - else - i2c_imx->hwdata = (struct imx_i2c_hwdata *) - platform_get_device_id(pdev)->driver_data; + i2c_imx->hwdata = match; /* Setup i2c_imx driver structure */ strlcpy(i2c_imx->adapter.name, pdev->name, sizeof(i2c_imx->adapter.name)); @@ -1316,7 +1299,6 @@ static struct platform_driver i2c_imx_driver = { .of_match_table = i2c_imx_dt_ids, .acpi_match_table = i2c_imx_acpi_ids, }, - .id_table = imx_i2c_devtype, }; static int __init i2c_adap_imx_init(void) From patchwork Tue Jan 19 00:31:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 367393 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1F59C433DB for ; Tue, 19 Jan 2021 00:35:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C537623102 for ; Tue, 19 Jan 2021 00:35:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732455AbhASAe7 (ORCPT ); Mon, 18 Jan 2021 19:34:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730466AbhASAe6 (ORCPT ); Mon, 18 Jan 2021 19:34:58 -0500 Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86DC9C061574 for ; Mon, 18 Jan 2021 16:34:18 -0800 (PST) Received: by mail-qv1-xf29.google.com with SMTP id p5so8388826qvs.7 for ; Mon, 18 Jan 2021 16:34:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pOUXNGm8cuKVuz5chOjLt+pojzdg6mYDZS4jNJyIMWA=; b=LF4jWrMAITpIZ4Jra0GJSQbO30bVnqoLZCddDLOx9onN5K/g3XF3t4Bzb2f9KpL/81 01wRCmu0zrRaV9i9bUFgou/1bRTzV4SLd3i6+UkhAKLMTzTe6GG6vDFVaMOUlDz64AW9 nCUkgI84+QGfehZbnawG9LZvgNpNbfMfoZSQroyQTZk3naLETayN0DkN7UIOCyPnioTc j+zxJ04n5/ObHd5a68ZoVR5KnIjTruMMKTH9J8i+2Izal7dD4gQrP2ymSxE4LQ9KneMi KKmktRUKtbIs84PIlEMp7thbrlTncMxqF7SzPH0gl3Ae6J/nvFtaXMAMpKWuKP8vaRjp T/qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pOUXNGm8cuKVuz5chOjLt+pojzdg6mYDZS4jNJyIMWA=; b=TrUVfrfxRFnDNiSY23bZRUy89nPad5vFN5GuZGQrD++6L7+QkBxnCycrGPtyLqpRko ZCmXviu7wTPureH8TY0w8wfWGABv0hOELoSG+2xupWSZ56G04K/Nn0dRLE6HvOqz/d26 dpP3oPLPyauV4jdYgqRV4vvzOHtJ843X3IfVO0b/q5jii4XTmafSCtLfPx1mEPkRZrC4 uZDCALfNMF/YNI39yFebxt7BAWl3pQmWqj0cZ820I/EkuwZi2ckccegLqe//i9a+3otM PWOOKUGfOH84zMqJDi3vTBLm3RwpPUk3d6i0IJbeBrbldSZ+Omr/bqAXCgeXBXnSlghN o/zA== X-Gm-Message-State: AOAM5328ss24N+3Jvw0gi5PD1Bkwhi1bxEMfvnAnvfzWJYl/eQx/Ly7E xw+RsjbMg5oRre87rV8E0qGBpEpO/ac= X-Google-Smtp-Source: ABdhPJy+iCsEaUkvkNRFpwUJhAmBi9kTXxLNGKzGGvb2u8J4gwMp9Z1qbkFeoekHDj2uEuaKjdMLbg== X-Received: by 2002:a05:6214:727:: with SMTP id c7mr2268095qvz.22.1611016457433; Mon, 18 Jan 2021 16:34:17 -0800 (PST) Received: from localhost.localdomain ([177.194.79.136]) by smtp.gmail.com with ESMTPSA id r15sm11791050qke.55.2021.01.18.16.34.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jan 2021 16:34:16 -0800 (PST) From: Fabio Estevam To: linux@rempel-privat.de Cc: linux-i2c@vger.kernel.org, kernel@pengutronix.de, wsa@kernel.org, Fabio Estevam Subject: [PATCH 2/2] i2c: imx: Remove unneeded 'match' variable Date: Mon, 18 Jan 2021 21:31:48 -0300 Message-Id: <20210119003148.1793614-2-festevam@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210119003148.1793614-1-festevam@gmail.com> References: <20210119003148.1793614-1-festevam@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org There is no need to have the intermediate 'match' variable. Assign the device_get_match_data() directly to simplify the code. Signed-off-by: Fabio Estevam --- drivers/i2c/busses/i2c-imx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index 5d0ce70411ad..6e5d26cf3f2f 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -1309,7 +1309,6 @@ static int i2c_imx_probe(struct platform_device *pdev) void __iomem *base; int irq, ret; dma_addr_t phy_addr; - const struct imx_i2c_hwdata *match; dev_dbg(&pdev->dev, "<%s>\n", __func__); @@ -1327,8 +1326,7 @@ static int i2c_imx_probe(struct platform_device *pdev) if (!i2c_imx) return -ENOMEM; - match = device_get_match_data(&pdev->dev); - i2c_imx->hwdata = match; + i2c_imx->hwdata = device_get_match_data(&pdev->dev); /* Setup i2c_imx driver structure */ strlcpy(i2c_imx->adapter.name, pdev->name, sizeof(i2c_imx->adapter.name));