From patchwork Fri Aug 16 16:42:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiju Jose X-Patchwork-Id: 13766602 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72D39C3DA4A for ; Fri, 16 Aug 2024 16:43:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 661D78D0096; Fri, 16 Aug 2024 12:43:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5C37C8D007E; Fri, 16 Aug 2024 12:43:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3A5408D0096; Fri, 16 Aug 2024 12:43:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 0E54F8D007E for ; Fri, 16 Aug 2024 12:43:49 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id B7CDE120156 for ; Fri, 16 Aug 2024 16:43:48 +0000 (UTC) X-FDA: 82458680136.18.8EFE0B6 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by imf29.hostedemail.com (Postfix) with ESMTP id CA4B812000B for ; Fri, 16 Aug 2024 16:43:46 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf29.hostedemail.com: domain of shiju.jose@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=shiju.jose@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723826572; a=rsa-sha256; cv=none; b=XyEqT32y06CIlMX2dk1HOAQpMXXU+JGMZqyrajoth42CUfoJOCiXOszd3HwEsVqorOYv7k G0cdjUQz0+ngwUoiDmZdaeM7DWIcHpqvBmwjTgVrEoh77c+U0B3ZUoxMyXSsbTEM5DYI34 28BHvBZSwvohMA3RKUaFUE/8SvE41ZM= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf29.hostedemail.com: domain of shiju.jose@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=shiju.jose@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723826572; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F93fuiYNl6Q27hD862498JBBQxXlQqyCf924P+Qz0zk=; b=3itDtOQNB2ke3quUvPzApExymgYKls6CV3iEkm8OU+fTsV4zPX1a8+maTmwwMylsH8AVDt Dm5Rj2Yr7WCpfIHwVVkR2e6RnAblqbfv40jj7/2pCYWNKWriQW3qS+4wzyYWiInVjuSSpQ +lfMJaudBVxemDl46g+YKBwx3tOURBI= Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Wlnm56jkfz6K5q1; Sat, 17 Aug 2024 00:40:21 +0800 (CST) Received: from lhrpeml500006.china.huawei.com (unknown [7.191.161.198]) by mail.maildlp.com (Postfix) with ESMTPS id E603D1400C9; Sat, 17 Aug 2024 00:43:44 +0800 (CST) Received: from P_UKIT01-A7bmah.china.huawei.com (10.48.148.43) by lhrpeml500006.china.huawei.com (7.191.161.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Fri, 16 Aug 2024 17:43:43 +0100 From: To: , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v11 09/14] platform: Add __free() based cleanup function for platform_device_put Date: Fri, 16 Aug 2024 17:42:32 +0100 Message-ID: <20240816164238.1902-10-shiju.jose@huawei.com> X-Mailer: git-send-email 2.43.0.windows.1 In-Reply-To: <20240816164238.1902-1-shiju.jose@huawei.com> References: <20240816164238.1902-1-shiju.jose@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.48.148.43] X-ClientProxiedBy: lhrpeml100005.china.huawei.com (7.191.160.25) To lhrpeml500006.china.huawei.com (7.191.161.198) X-Rspamd-Queue-Id: CA4B812000B X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: rb9668h7d3shfajwp4i7h74kj7ctbui6 X-HE-Tag: 1723826626-993697 X-HE-Meta: U2FsdGVkX1/sVVJUTZCQFSHWi7xFoN3whi2cW4Ug/aEiYqU5w0DPCeYVyS7MIKNVW8bATyRUke9RnZyOiZWIzPFR7kaTqBtSDfGHWvKwgCgONUq+K6M5DdE2ipVGOh3bZPoltGCxSwFmNrvQnG9vujlibtRYYfjQHc6iImPnMdv3mWetwfP6C8t22+S+1M6EwMtHn9vcVdyf8/l3t8Z0Wbe+zvvM6GAReYfIm9xmlmiyqRIHC3dj98cFnfFl56ZhHdzIX5vWRc8PdGd4DmAG34xXSLdB5gw1jvVK5Q4h+ad+43ePj7anUzKWJ3IWZd6nmUKXzIkOkLJMlufjsJ2ustDsdhA2/nopPRobU6T62ZbC4J/arJ48ea9vskeW150dZGS/Ekxq6uH5kE8FehxWLhOu9TcfkC+SeIVB7Px0qfNmoRjjDij2t7Tp3OzBkku6Ts3/QEJyMHh16mOw4rxrcV6r46ANGRtimafQngX0XxeHyP6pCOT/XWU54XRN0a+KUNaeTDvgy8MA71YjqFWJijx3VHQBuQVboX5Rv+1Ek3y+XJ9KtJbGsDuv6MGEWJ0QorFeLWUd8WarP6MbxLoXoVyOijEk6vyNXGsK3zd2khoLf+iWRm6ljFpJ/kTdQ93vqlV2ySfOeiD2yrin91fNuVLZz6i3ivwOM6ozCo/TcabWeK+82NnzYKyfjdEb+RZKNQ4rp41kCihJXQ+sleGyg2w5TBp2uPa0kyauU/JCes5nop+BznTcTdjeC39K+ykgQzjDPkHlqXHpf+BxUGF0yisv3AMKpcLlUNO0P/IDsHqG9n7yGFKF061Njt9+6VQdo9+KDZ01j4o06f/EL7dGhhSUEKr00SOyn5g4QuCB22tFkdORNZ9pOVKBHEwA/N2W+Q4/TVTA8k8m6brKvjktdzESOd6loxr9X1jRK7BwzUHJ9/8vDLsYQWwR2uAN7hWyAWaaH6n0pVtWVZ2X0VG gXUneQQP lm7002wS4mI/moOrqX6Bv9hHcsO35kG0UTldeXrEZBAHkUhtoqcrO972/p068ZN6knMu2OTatf0idMMDHmjnudFsYlp/SLcwaeDNuyEhFwdI8y4qWhy0RZoTlB2oj9NcdXdwgoE8A/6agCmK8O/dLcPd7+B/z5As7VYntKJXpFmrIv+EZObogXSLEDc99A+lyWhPd0NRTBg33K6VtSelNoSqy6V15F3w6eO/Vw07dbv0swnb5EwWmbFlI9ajOrSDy0C2WZjM82X6amS7pLBBT3Qx3oujJFyrtEBbTpg2EWhbt24g= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Jonathan Cameron Add __free() based cleanup function for platform_device_put(). Signed-off-by: Jonathan Cameron Signed-off-by: Shiju Jose --- include/linux/platform_device.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 7a41c72c1959..1ddc35623b4c 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h @@ -232,6 +232,7 @@ extern int platform_device_add_data(struct platform_device *pdev, extern int platform_device_add(struct platform_device *pdev); extern void platform_device_del(struct platform_device *pdev); extern void platform_device_put(struct platform_device *pdev); +DEFINE_FREE(platform_device_put, struct platform_device *, if (_T) platform_device_put(_T)) struct platform_driver { int (*probe)(struct platform_device *);