From patchwork Mon May 15 17:50:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 13242007 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 D3463C77B7D for ; Mon, 15 May 2023 17:51:19 +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=zref2h46vDZke0jBR7/shRkbTvz+aglwgoyoTTM3JtY=; b=YWm3cBed7m3uFC 2hrNnj6slvQAgvEuX8qwnebCtCOJdtZzp/YIfOV2/1lHAaIwYM4lx6xjAimKBTj+Doy6lLSRqhbTs co4iDYXEYQguJ4LioQrmg9wcMkb5O/t4XypqWu9KwI4XNV2EUn997wDpP3tdzGM4MzpTz2dT/w9xO 2yxpjV8qkTWQfxBh+C3QvR0IRJjlBGVV0qacHgcAgAFkDO+Fbn6ivjRacsEhOrzt++ouTqH2x3aHo u+ms2/P/PhSb5MdZM5YFBU4i+75rUWdjzj7ChYpVkHqTwHUqW4sqZHvmmqd25ZJJpoS8FCY+bGWul 12s5yiBf6a0U+zhINV5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pycLY-0032w4-2o; Mon, 15 May 2023 17:50:56 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pycLS-0032qR-0C for linux-arm-kernel@lists.infradead.org; Mon, 15 May 2023 17:50:51 +0000 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 34FHohqw026890; Mon, 15 May 2023 12:50:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1684173043; bh=li1qACpEc+UiOMT6jAFyohJIo3GdjAxTe9n1fUN9AiE=; h=From:To:CC:Subject:Date; b=v9tiwB0Bgx2QtIRTsyCWaYsPaFqE0g0Wv391XowCuAHuBR82X6X8KZCT6kGiRBT22 zsxwMFlR5HcgwgfybS1JDh3GcC2O4sbifqYg4W8hdBrsyJ+V2BFSXsbKhuY5Ys1iJ1 7yZ3iupwfdZOh1DzZOMsiTrAH8t4Q6G1xy0PLDFk= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 34FHohA0049310 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 15 May 2023 12:50:43 -0500 Received: from DFLE115.ent.ti.com (10.64.6.36) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 15 May 2023 12:50:43 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 15 May 2023 12:50:43 -0500 Received: from lelv0327.itg.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 34FHohNp060959; Mon, 15 May 2023 12:50:43 -0500 From: Andrew Davis To: Wolfram Sang , Bartosz Golaszewski CC: , , , Andrew Davis Subject: [PATCH v2 1/2] i2c: davinci: Use platform table macro over module_alias Date: Mon, 15 May 2023 12:50:41 -0500 Message-ID: <20230515175042.495377-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-20230515_105050_138596_EBA95A20 X-CRM114-Status: GOOD ( 11.57 ) 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 Reviewed-by: Bartosz Golaszewski --- 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 9750310f2c96..c55bd937def7 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c @@ -940,12 +940,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 Mon May 15 17:50:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 13242006 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 E2AE6C77B7D for ; Mon, 15 May 2023 17:51:13 +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=aCTbDLSix+174XVAJLJ9BaYHLCL4qMGZaDMyCAfmnIY=; b=FciWVVREy5dxSo yC2T6Pv9/aMUSt2uCf90t4ma7VO05xv6vCFo1TP/rJkUQGGk7WHzAWtwAqpayd/i7wwwJxihObQlZ SkI0twgtLXJiFTeNTqUR/vtH8xyw0yibGpVkbw7CjvsBRnvXtlxgfjqPOBfZO7zguZLPyOwSsF3f7 UYtZdIm6InN54VE2/QcTVM7yuixNJH0K36pC77+ER6vfuIAsM8jKDAOn4egXkxyxrn0eyXQahD6+r JgL5zGQzMyFfRMrs1eYd4AzdQlcCuo6dgsov7xloYzqTnYAURpoo+bM3nEtSfnEe5TFXn70mdpZ/R WNuk21EMwqUaTP9UzCyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pycLT-0032t3-1X; Mon, 15 May 2023 17:50:51 +0000 Received: from lelv0142.ext.ti.com ([198.47.23.249]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pycLR-0032qH-16 for linux-arm-kernel@lists.infradead.org; Mon, 15 May 2023 17:50:50 +0000 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 34FHoiRi010789; Mon, 15 May 2023 12:50:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1684173044; bh=38tdvWK8lJabqgnOU0Hs8iF8EpCwonFKkFkL2o92fvU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=a3PDVgb9blJwuByXbXNDbQmFKz2rAS+3gw/BPz6NsfeVUejnTU/cxcuaOeSXn/85Q eDAYdkxLsoYeSrEiqVsRWlOZP+Ma40sHloNzpSlRsG/TndxoaYEwQkBP3K3jpmdXkf +1ieb/cYasA1nYrjBxmd8Bu+an+GcCm32BMulz4k= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 34FHoiLu124129 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 15 May 2023 12:50:44 -0500 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 15 May 2023 12:50:44 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 15 May 2023 12:50:44 -0500 Received: from lelv0327.itg.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 34FHohNq060959; Mon, 15 May 2023 12:50:43 -0500 From: Andrew Davis To: Wolfram Sang , Bartosz Golaszewski CC: , , , Andrew Davis Subject: [PATCH v2 2/2] i2c: davinci: Use struct name not type with devm_kzalloc() Date: Mon, 15 May 2023 12:50:42 -0500 Message-ID: <20230515175042.495377-2-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230515175042.495377-1-afd@ti.com> References: <20230515175042.495377-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-20230515_105049_424608_9F2864A2 X-CRM114-Status: GOOD ( 11.94 ) 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 Reviewed-by: Bartosz Golaszewski --- 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 c55bd937def7..135f76593e6f 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c @@ -767,12 +767,9 @@ static int davinci_i2c_probe(struct platform_device *pdev) if (irq < 0) 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);