From patchwork Wed Oct 9 12:41:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiju Jose X-Patchwork-Id: 13828313 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 A9A56CEDD89 for ; Wed, 9 Oct 2024 12:43:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 664FB6B00E6; Wed, 9 Oct 2024 08:43:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 615AF6B00E7; Wed, 9 Oct 2024 08:43:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4DD5E6B00E8; Wed, 9 Oct 2024 08:43:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 2FE946B00E6 for ; Wed, 9 Oct 2024 08:43:38 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id CE47412151F for ; Wed, 9 Oct 2024 12:43:35 +0000 (UTC) X-FDA: 82654030074.18.67F363C Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by imf07.hostedemail.com (Postfix) with ESMTP id 09A604000D for ; Wed, 9 Oct 2024 12:43:35 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf07.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=1728477715; a=rsa-sha256; cv=none; b=hB/djWhmwKSAg1PNJLZBWqPkppiWI0URNpF7QrJcmRObW4+ErSQm3RA+CBoAvH2MT/yFsQ SQZuaGw5jNRUfuYhZBelonrnVF+OGn/YYa8LTivJa+XgPkr0vhLoT2Hf3uMbEFwvDzb28k 7WDfolxa/XISirEOwvhoeUNAdX3DmGM= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf07.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=1728477715; 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=xQn+K7uau8gfzBOtxde9J3S4vks7fEmCec582j5fvco=; b=kgNoMNocYbZGFg0z1W0ew1OAxdl5uKtE4jzL/lItztE3LYY9RUoTZzh5BXm0M2NPITYAf3 C1jrWwHJs3OdC1b4FbwyYQQP4YbDA0ftLqcUff/93dBjSIRFeXPL9rA13c94dBDII9JOKf YVlUaaBgIls9SGrelVu3LsZMj5Gl3a4= Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4XNsxc1SXnz6GD5T; Wed, 9 Oct 2024 20:43:16 +0800 (CST) Received: from frapeml500007.china.huawei.com (unknown [7.182.85.172]) by mail.maildlp.com (Postfix) with ESMTPS id EAEAB140CB1; Wed, 9 Oct 2024 20:43:33 +0800 (CST) Received: from P_UKIT01-A7bmah.china.huawei.com (10.48.152.209) by frapeml500007.china.huawei.com (7.182.85.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 9 Oct 2024 14:43:32 +0200 From: To: , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v13 12/18] platform: Add __free() based cleanup function for platform_device_put Date: Wed, 9 Oct 2024 13:41:13 +0100 Message-ID: <20241009124120.1124-13-shiju.jose@huawei.com> X-Mailer: git-send-email 2.43.0.windows.1 In-Reply-To: <20241009124120.1124-1-shiju.jose@huawei.com> References: <20241009124120.1124-1-shiju.jose@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.48.152.209] X-ClientProxiedBy: lhrpeml500003.china.huawei.com (7.191.162.67) To frapeml500007.china.huawei.com (7.182.85.172) X-Rspamd-Queue-Id: 09A604000D X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: tb6jm7xuamqkwn4o7bbb3iyrkqm5src3 X-HE-Tag: 1728477815-928637 X-HE-Meta: U2FsdGVkX18WI/xBDpNR21knGTya0m4KS4gQzDBFxR1+cErwu2vH9Ypnyc2Lwdeqk2ettzdh48QOmwF1JUqr08t+yOsY2VO4Qh1i1AVEaoYwWq1EEe9EhKtTj/1Iy3crJvMKcVosXOoTfe5dtppCZxSxyAUhNjAp+Ih80KRFXTaOpSVN9QWrMBew/DvPdAs/fcpCYDhRSX6xbeX4a6SiWI9iexqd7BNsRZr5ywooL8Svf1F/ctG6fCvdul+zH2PoQbmm1Ip8KHsYJG5emRRthHgtsza2bXIj/vTfUirUIWyfW4/AixFyE4hB+vs3jl5B0uq0ndDqFX9M3iYF5BDgIdED6sX40HfxETOeJfkuJ3anlxENMepCF2oWrCUgzgCGhJmEjHmqy+20F0iR4JnXi+YMzUVLYdL3EVXYCPZhbYOHzyS0abeM00bxCUArHV+vderkiCFWGBcgH7oGqLr39WfjT5OPqg60ewaiTOdFUFjDRMT5ON+5dPLr2EWSaAByqWmDkkgBB6NldnFGhIEO+Gy/jrpK4SNMtnysHmhWAdkMlor26oaPb1kOeV7o2e9+oMoAG0y+kXJcj9T4BpFqFgCxwbUAoeXXKejrBezMtpAz2smiZFc+FeyDtNDAejBNqhBZXlKfAF0mb77MmsAXZDv5JYzifM1ERmH2iez8pdRRRT2geBAglUvejQ0sJ3sIWOwJ7bNOvd3j+6x5IkKK0y6qVKHIhS4TAFvWJgIcllbCNlif61+xHN9hPj3fyYkud1A3AqUy+ENkG2C+fTJRFHPl5saOjpVncS8Yafi3yFBK+8PeK842OTrO2Z+FKqRFGC1GasZ8Ko/kAh1PFswFXJbLASXoBElYir+pKTR+MqjNR4bu98eWiww9MKv86iW2s2W/zdBWSVIF5BRR0ZlqDz9CuR/du3QghD2Q4xe54mEaKFBQXPP6SLivQ7KXA4XY7bRhniZs4W/VEGte9OG zLRzCehJ 4glihBlJyTb29LV+qh+XVPpHoXsE6D295T8X+EFS/WxGqJDDi1EL+7Yg3KMTm4P5ixcftPjXz40XIUidTgnsoXmyKQ3wfmK8+jiIBl8aHpd77pwAJ1yZiljKg6k9/9aBKOeV29qhrtGWRuN6GRmgHYbO2N1MCcwpAv7W+LaXbO8qzRPB0XmamhYBILhOhL07NsA/WrfV79+IByYdWduFMc7CiIAo29izjfNwtWrprLstTublDsFE2Py1KMb56AZGgL9qoKQAlEBHgSXUhMvygciFisSVuOjdO36bCHlTiC335MyM= 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 d422db6eec63..606533b88f44 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 *);