From patchwork Fri Jul 26 16:05:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiju Jose X-Patchwork-Id: 13742936 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 E20B8C3DA4A for ; Fri, 26 Jul 2024 16:07:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 45B4B6B00AB; Fri, 26 Jul 2024 12:07:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 344D36B00AC; Fri, 26 Jul 2024 12:07:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 148BC6B00AD; Fri, 26 Jul 2024 12:07:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id DBE446B00AB for ; Fri, 26 Jul 2024 12:07:09 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 89D20160A60 for ; Fri, 26 Jul 2024 16:07:09 +0000 (UTC) X-FDA: 82382382978.29.325C8D0 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by imf16.hostedemail.com (Postfix) with ESMTP id A934A180012 for ; Fri, 26 Jul 2024 16:07:07 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=none; spf=pass (imf16.hostedemail.com: domain of shiju.jose@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=shiju.jose@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722009988; 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=8ROrPrstma0NMwygfGqyePsFqRsloMKpzJ1CdugTlrOkwaaX5sCH/Lb9elBsf/OdXla6wl I1yyVnjE3RXfML41j8wmfdx+u6FvMEZaD9iQkiFy7Vq1N24tPSNGGazL4UI9ePH5WIdfKH pcgKwetK2s58P3Ry9btAYPGZXv9ewW8= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=none; spf=pass (imf16.hostedemail.com: domain of shiju.jose@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=shiju.jose@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722009988; a=rsa-sha256; cv=none; b=CZkMg/bjBfyKn8beOctECld0N/3o8tUgT51ACyazqQVtrfnv0sd6v3MZpWZgXV/Ov5ssuy ElwFPsQN4iT1g5FEm0lqFgcSh4Diswpv3PhBHyAgXaDIo6NCiLJc02ODYqNGwJ/5rp369B ADTFmkrUU5JOYxj2FlqsDbW95ecBGcU= Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4WVsyZ0V28z6K9LD; Sat, 27 Jul 2024 00:04:38 +0800 (CST) Received: from lhrpeml500006.china.huawei.com (unknown [7.191.161.198]) by mail.maildlp.com (Postfix) with ESMTPS id C28AF140A30; Sat, 27 Jul 2024 00:07:05 +0800 (CST) Received: from P_UKIT01-A7bmah.china.huawei.com (10.126.173.33) 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, 26 Jul 2024 17:07:04 +0100 From: To: , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v10 09/11] platform: Add __free() based cleanup function for platform_device_put Date: Fri, 26 Jul 2024 17:05:53 +0100 Message-ID: <20240726160556.2079-10-shiju.jose@huawei.com> X-Mailer: git-send-email 2.43.0.windows.1 In-Reply-To: <20240726160556.2079-1-shiju.jose@huawei.com> References: <20240726160556.2079-1-shiju.jose@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.126.173.33] X-ClientProxiedBy: lhrpeml100003.china.huawei.com (7.191.160.210) To lhrpeml500006.china.huawei.com (7.191.161.198) X-Stat-Signature: 5mmu8qkhrskx9cb1biyj9o1wm78m98rm X-Rspam-User: X-Rspamd-Queue-Id: A934A180012 X-Rspamd-Server: rspam02 X-HE-Tag: 1722010027-592329 X-HE-Meta: U2FsdGVkX1/xhpMCRizup7/GQ8I+7+r63oEWUo29jeFtxSSWLCXGvbcP9j2pdPA3QtI15OCxB6bhVdrCtyi9NZxqsh3JrXQ8LDVtT3BkJh3vuxhFuvoqBCQbEryqsDSzf4kgjCV50sRDR6VQFt3utpAORadCEHMbuel4hadjuRc/D6YL7MLkCcy0uB15EJrsAF9zihuEQ90v0+t1PAEJiz4SBGD94RMnHHJmDM3z4uQO9ZYUkdTcw4cZctTDzLlwVIl7sPl3kbRmwwt4WqmBAH9An3csKm2skWnt/NBNAZ/2kMicb/iORBe1YHKV7y+0NxebzhUW1kyN9V+nFAxcGbkvdI+aAPpqMT7mV8go9HQnRjj9lk2ZX1oARhX3KsWcGM4HxJRKFT83TXXXiHvkwhLo3ojiu4lXmoUUt2ESYr9E9K9VVNQbhkyqBR5z51wnDAJgNPq5WKiOaBtKrfhtdTsXo0U368S6aDyGHZJx99pSDN+kiPNsSiY1qgQwFIf9YZ/uDj2/aNj9FFNFt1wfdj0ahJQQzwWoaMOUinYNRU7u10/Tg6xdNcyanP39TplEsVPXXadDQqKConVh6PJqlusoxBKwPvelY7D4f9fVj9cfMeheDRa9NqEurKJE5B9Uw0wpfDKx7Aoyl5JCuQz8ODKCJHtzVIeU9qQWAX8dFyL1Q9krHSc/4rXYPJFw1dnwJJtHjLc1t06e4DLfwMrOS2k/myexqm7p2T9WUiMh0jM4VpYV070Z44sjaDTZWpVbexqzyuWQas12HezPjp4V647gsNsgDHd/ha9sqshSfOCi8JXzOZ5H/u0U66FsOBTDZ7MpES5r3AZgH8vttz3Y/cU4MirgYo7SIYLzaDT3oc0eT3RpsaX9ArdW2LCoapD1r3tMYR1VWCr+Jk2nLjClGf67E1xsq3KINRKJwxs0FM9jCVK70ymcO3e0eSlkvCkSBYygnAlf1f1xkQzqBA+ IYwX5Lrb EiYsbkeG6Bw0ueYqy75VD52sK0/27Wt4MTuZQyJrLwn81kxoX0+wwjWovuuNFhoeLNMKaT2zQaUQM9ppncolnBrGZCuB4t06UioeQTo0KSc5bVoPz2BM7390gwI2c+tgLZrWVHosSuJ7ED6yGfCIZwue5FnLNPz5g85FJcC7HhATkO8rGyU6eo8DSGgaxskdf6j4attOgoRViARqqrWyhQyMUyaOdSYd+6dEIyrQCOtxZBpf7wqzlcro/TD88r04GPacb/e/K5GfiFJESo4lumvFogpiQuS26bJ33hLkA5wvKFis= 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 *);