From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D79691B4F08; Mon, 14 Oct 2024 15:43:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728920626; cv=none; b=SyEIigGxQRHWzx2lxTsIXryvV/E2eyMaSuB+1JnfiM/RNNEnAId7ozcVxZYgjCFvgIA+7CRA5v/XXh8JswUreZF3b6pUx4t2FAJdzRg/74kGY+0WPZrPwbPZDOcnRspLOjRxK14pmsVxQ79NgEpdpayH4WCm84cJWOUP1q/nvFk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728920626; c=relaxed/simple; bh=7nmop8CzjDqFHMsbksGN5YGc8xGx7c07Z+K2Kdm8kZc=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ugY/M+UW/3wmIveSQEGUtlM8hS0MFuuSFJMc7dKSWzpO+XgjMDmwL5DKKJViaiHJHYqRdUdb0YZ3i9M+zkhgj0Uem25pD6QSnqp5cSK8De1wQ38cNNJWsCpVWcoi3Ku2OWHw3rTLvxycKFOo/D68VhzqGYFY7dASYdxeGuNpSmI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4XS1ht4Jfkz6HJnq; Mon, 14 Oct 2024 23:43:10 +0800 (CST) Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id A6D6E140445; Mon, 14 Oct 2024 23:43:42 +0800 (CST) Received: from localhost (10.203.177.66) by frapeml500008.china.huawei.com (7.182.85.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Mon, 14 Oct 2024 17:43:41 +0200 Date: Mon, 14 Oct 2024 16:43:39 +0100 From: Jonathan Cameron To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , "Rafael J. Wysocki" Subject: Re: [PATCH v13 12/18] platform: Add __free() based cleanup function for platform_device_put Message-ID: <20241014164339.00003e73@Huawei.com> In-Reply-To: <20241009124120.1124-13-shiju.jose@huawei.com> References: <20241009124120.1124-1-shiju.jose@huawei.com> <20241009124120.1124-13-shiju.jose@huawei.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml500004.china.huawei.com (7.191.163.9) To frapeml500008.china.huawei.com (7.182.85.71) On Wed, 9 Oct 2024 13:41:13 +0100 wrote: > 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 *); +CC Greg KH and Rafael. Makes sure to include them on v14 as this needs review from a driver core point of view I think.