From patchwork Tue Mar 7 17:30:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 13164276 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 48E6BC6FD1A for ; Tue, 7 Mar 2023 17:32:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=oV16da4oVr6dVXeqP0uLtxHUhRwkT9ttnEl7r/fVL7Q=; b=Gc/J0twr1ByKON P2rRrGWxYUVhin3Sau39TJbzbXYanBydxIULZWeJcGQrw+aTQ2lqs/j1LrdzYrL8AWVxl7BWaga1o G/wPeUTnSYJ9bIkjYVsU+XHiYD3wfurh3644797EhcsMBcECFJ5PD+UXQwQ7UwnicHq6aDVwaSYfc 5EmA7Zj3iX10ak/OIC4sELG4yWDEW+QcrhisLxmzMcw+tO52Tsf6dnAf3AEFz/jjjaXcheEDVIVlf QtjviDp9ZlL7rxF7EdPz4iQUMimaaPIyi3eDDbYU4uAh6y4KqmI/+Kw+n2s57tmvgNBmwKBe0/+z1 39UXXqZyR/Wr3vowmrzQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZb9u-001o3k-4U; Tue, 07 Mar 2023 17:31:30 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZb9T-001nrb-Le for linux-arm-kernel@lists.infradead.org; Tue, 07 Mar 2023 17:31:10 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 327HUvWm101754; Tue, 7 Mar 2023 11:30:57 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1678210257; bh=PKKOuaAa2gBguzQqapfZCABAxRkqv+t5CDo+WBJoBjM=; h=From:To:CC:Subject:Date; b=zDZ9PuGLZPOFMiqNXMvMrzkgGj5NXrOciLjfMxye4K1tDBmaxTq7ZTw1fvdRoV6SX 3sbi+zv1ELZ2RFjris/q6URurCkKW50BsfItYs7K0IPY8RWoZJAEldPJmg/LdTy936 5RTG+Mz8mvP4wCpdY6YVxKfn7yBGgW3Bkre3ANNU= Received: from DFLE110.ent.ti.com (dfle110.ent.ti.com [10.64.6.31]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 327HUvRM094402 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 7 Mar 2023 11:30:57 -0600 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Tue, 7 Mar 2023 11:30:56 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Tue, 7 Mar 2023 11:30:56 -0600 Received: from ula0226330.dal.design.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 327HUuU9045064; Tue, 7 Mar 2023 11:30:56 -0600 From: Andrew Davis To: Wolfram Sang , Bartosz Golaszewski CC: , , , Andrew Davis Subject: [PATCH 1/3] i2c: davinci: Use platform table macro over module_alias Date: Tue, 7 Mar 2023 11:30:54 -0600 Message-ID: <20230307173056.30164-1-afd@ti.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230307_093103_819194_3E954D4B X-CRM114-Status: GOOD ( 11.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Generates the same platform module alias. More standard usage. Signed-off-by: Andrew Davis --- drivers/i2c/busses/i2c-davinci.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index c836cf884185..abea1d86035c 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c @@ -943,12 +943,16 @@ static const struct dev_pm_ops davinci_i2c_pm = { #define davinci_i2c_pm_ops NULL #endif -/* work with hotplug and coldplug */ -MODULE_ALIAS("platform:i2c_davinci"); +static const struct platform_device_id davinci_i2c_driver_ids[] = { + { .name = "i2c_davinci", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(platform, davinci_i2c_driver_ids); static struct platform_driver davinci_i2c_driver = { .probe = davinci_i2c_probe, .remove = davinci_i2c_remove, + .id_table = davinci_i2c_driver_ids, .driver = { .name = "i2c_davinci", .pm = davinci_i2c_pm_ops, From patchwork Tue Mar 7 17:30:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 13164274 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 95C67C678D4 for ; Tue, 7 Mar 2023 17:32:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VIcnmS9fZo2KqoN9iE4Kdvnpe/Vh9k26haKxBy47lZo=; b=KvhfBaBOsE+LTR JJKFnUDpNpI7OrDs0pJ12jzVl3GQBytpsGUs3iGnzLvuk9n9LjA9FPYVEm9eT53dvdhm90yMa+rNn +nffsJ4rw6hy5QmGOdEzenT1D7DUv5fjRK4drPqQ7XphjWPPY3HGLN06htVv5PTZnywANC48PKAPo YdHXU41N9nadvlpLWHWXThIXu1qZWV6C5h28P9y2vMOWeJWpUr2Rg7YH1cFLoYZFGvJ6G9qdOX0BR Do3eeT+qEgFoZQXBlrEzee20LVn+HOSA0nBfXI6QY4fbgjI0YlFNwfkcYLzw3C/x8cXV0So4F7ZnQ WewhDY0QvNc2w7i80aGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZb9Z-001nvD-69; Tue, 07 Mar 2023 17:31:09 +0000 Received: from lelv0142.ext.ti.com ([198.47.23.249]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZb9T-001nrP-JW for linux-arm-kernel@lists.infradead.org; Tue, 07 Mar 2023 17:31:08 +0000 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 327HUvcG042899; Tue, 7 Mar 2023 11:30:57 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1678210257; bh=6fCjEtwtv/IPhK41kwFaKhQDIWfKphfj41b1psqgSS4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=rS9gqOBFX2bgl+o3MSa2d4TrjjkfntbVY2MopaF25Tq10Om0L4+/q70zUgGWzFPid FIBVHI7kvMWVPFnXQCbjah9Cn24HzRPA0Z3fu3kKhQMriUWLYe7f+2HvB8PBsRES3W HRqWuAt4RprTk7chx/32wjc8bQrQRomy+J2aVvDE= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 327HUv2v049933 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 7 Mar 2023 11:30:57 -0600 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Tue, 7 Mar 2023 11:30:56 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Tue, 7 Mar 2023 11:30:56 -0600 Received: from ula0226330.dal.design.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 327HUuUA045064; Tue, 7 Mar 2023 11:30:56 -0600 From: Andrew Davis To: Wolfram Sang , Bartosz Golaszewski CC: , , , Andrew Davis Subject: [PATCH 2/3] i2c: davinci: Use struct name not type with devm_kzalloc() Date: Tue, 7 Mar 2023 11:30:55 -0600 Message-ID: <20230307173056.30164-2-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307173056.30164-1-afd@ti.com> References: <20230307173056.30164-1-afd@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230307_093103_727419_C00241A9 X-CRM114-Status: GOOD ( 11.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This reduces chance of error if the type of "dev" changes. While here remove extra error print out, this is not usually done for memory allocation failures. Signed-off-by: Andrew Davis --- drivers/i2c/busses/i2c-davinci.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index abea1d86035c..4a8e7728ee29 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c @@ -770,12 +770,9 @@ static int davinci_i2c_probe(struct platform_device *pdev) return dev_err_probe(&pdev->dev, irq, "can't get irq resource\n"); } - dev = devm_kzalloc(&pdev->dev, sizeof(struct davinci_i2c_dev), - GFP_KERNEL); - if (!dev) { - dev_err(&pdev->dev, "Memory allocation failed\n"); + dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); + if (!dev) return -ENOMEM; - } init_completion(&dev->cmd_complete); From patchwork Tue Mar 7 17:30:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 13164275 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 94E55C6FD1F for ; Tue, 7 Mar 2023 17:32:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rg8lFvUS4LMgZEa8PMI/ygtenaT7Op2PIZL6mJoHquY=; b=rXWkzo0RQ2QRZI TePNUhKC+gmNcDaX+ETTE2KuLmi7OHFAPmy+X76pYGnoZK7TGsX1oBIeqDqb1qJ/pBuYacWmg50DD oqP3r1eXbq/sQpVuNl9eZE19xxBUES3+xlI3gfwjSqTH7PqTqvCDpg2J886dQVTAmB5VXv1NteJUE VeC5TsAM9ycOKfB3A20UBkzBSZu94AG1k9DsDk1eIl92NpmDsr8IP6CQYFfRoFMbcjdZhBXmgezNr /jooo9fmv/AXugEUgO65zNJrXiERcLwhjYoROLS6pV3sxA8z2OUAPeMUQGl5PLPuWjNJEDGiWZEry X6SOkVc1c7G0naGWgDyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZb9k-001nzA-86; Tue, 07 Mar 2023 17:31:20 +0000 Received: from lelv0143.ext.ti.com ([198.47.23.248]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZb9T-001nra-C3 for linux-arm-kernel@lists.infradead.org; Tue, 07 Mar 2023 17:31:07 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 327HUvK4004926; Tue, 7 Mar 2023 11:30:57 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1678210257; bh=Ps8FiHY1KWT4BUFmpIbJrNMt544kBMXkEtn2e1pvBwY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=UJ+ApJhCfdg0NNpxpd/ePso6l2Do5SaJk+BrkVjhONx9etsQDQ7CjaC+WrQS/lUQp uD+Er61KWS3SSu4kjAqIKs8KfvvHEnxeHIbUXIEV+W4GoX0ZP3Ps6eQ4dBDPFAkCFI rYiihiUFmPUUQ6QwFqcJsFXKEdT/4dv7VkjFkI0Y= Received: from DFLE109.ent.ti.com (dfle109.ent.ti.com [10.64.6.30]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 327HUvLS094405 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 7 Mar 2023 11:30:57 -0600 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Tue, 7 Mar 2023 11:30:56 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Tue, 7 Mar 2023 11:30:56 -0600 Received: from ula0226330.dal.design.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 327HUuUB045064; Tue, 7 Mar 2023 11:30:56 -0600 From: Andrew Davis To: Wolfram Sang , Bartosz Golaszewski CC: , , , Andrew Davis Subject: [PATCH 3/3] i2c: davinci: Do not check for IRQ number 0 Date: Tue, 7 Mar 2023 11:30:56 -0600 Message-ID: <20230307173056.30164-3-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307173056.30164-1-afd@ti.com> References: <20230307173056.30164-1-afd@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230307_093103_493577_C0999D88 X-CRM114-Status: GOOD ( 11.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is not a valid IRQ number and will not be returned, no need to check for this. Signed-off-by: Andrew Davis --- drivers/i2c/busses/i2c-davinci.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index 4a8e7728ee29..135f76593e6f 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c @@ -764,11 +764,8 @@ static int davinci_i2c_probe(struct platform_device *pdev) int r, irq; irq = platform_get_irq(pdev, 0); - if (irq <= 0) { - if (!irq) - irq = -ENXIO; + if (irq < 0) return dev_err_probe(&pdev->dev, irq, "can't get irq resource\n"); - } dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); if (!dev)