Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp988554rdb; Sun, 18 Feb 2024 23:48:51 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWio5xrWxYebmBCOLYVbS03WuP/sPbmB7nmH4af5n0zG/cKi9dSL6mN1EdnNu8vWPyArwvyhiVBvydz0voZJOBcvcXFjSNUPma+IeG6ng== X-Google-Smtp-Source: AGHT+IGe2enKRLnVGzxGaceMy1zZDcuZAWRUqOGyVB0rtvO1BkiA5KXFWIITKks9OXyuZS6iWLH5 X-Received: by 2002:a17:906:34cc:b0:a37:b8fb:50e0 with SMTP id h12-20020a17090634cc00b00a37b8fb50e0mr7973907ejb.52.1708328931364; Sun, 18 Feb 2024 23:48:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708328931; cv=pass; d=google.com; s=arc-20160816; b=lvPpYXMacndP4PL850pJUHxi2LH6zTu3OFy44hAEWZfB899BOulWYNKKS0I/ZBTbYg NrK7bjuYuUmKPlNEuHUUjsPDKfn0RNWpqvujW3J5ZLDBtxbc9dvqiyc5KNnahYw3u72v Si/Ks+MBctx8sdsZO4pHYN8qU+gltJpSbj7mUtfyDSyHl7K87Qbrr4jG0VJq0Uql0ivP SqSy9Sqc6h6O+JlzjEYskg8QDpa0h1vlLih/YlsIs0Y8nL+OkvaSN8OKCO73vvYjZkU8 aQSovkBx8Uaq51ypZhDvZb5Dr7GkdQPVMlW0bMoIkQLL8ldNbPWGiRmdjVXAUU+oJ7pQ n+hQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=IAJqf7TLGdE4tP58EDY0uQ3jiuoqFPiZBdtoxL4fjNE=; fh=9JZBrvtwCG5066tN718e69nt6/Z/miRqupfdz0ojAcY=; b=X6OWOmDZZdE72loHHZEpasVHwZm5q47g8mQ4VFHQtEzEpBFWZWdv6y+03BlEUHhyfR qq5N9guoupFmnReQ/jtABtU6dNesq/ew4P59tWZjO0ccmHkhaAiPD6AHtDa1NNQciLYE LFsVYb57K/hHKUXcMolMr0rTgd4SFultKLQglbs1wGw/BWNv/sSs1iiujmdoIOs7y9yo h6rrP33rMk9KpMJ9/+xnYQUz5qG9UbPdAySWCpWLFeQgPJVNyVqy/vFwsPKqwYruGH/d 3PAP6uKfiHhEmByW+IZyLPiOMochBXhJzTwYyF66i8kfU0IOajUFDIaLOotP6g/AdpQ+ 6Xkg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-70860-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70860-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id go44-20020a1709070dac00b00a3e544f1944si1315822ejc.1021.2024.02.18.23.48.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 23:48:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70860-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-70860-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70860-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 25DA71F214C5 for ; Mon, 19 Feb 2024 07:48:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DF33B20DED; Mon, 19 Feb 2024 07:46:41 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 B14CF208CF for ; Mon, 19 Feb 2024 07:46:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708328801; cv=none; b=j39cp5AvSWPt1Tn7FdeAyp4hTLmqWyNFCmzHjlVwPdVZXaEmXrtEtFzdUsl2FShHcs0TGZ0C15dUZILC/MMjH/ckZ3u8n1VKpR7rnvVuJJ+BAESWo9A02ESbYIE+WqlNaxxtQhlgVrhgstSGMtIYdt6uVkj7YZ4hShjwlo6X/U0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708328801; c=relaxed/simple; bh=JfG0uoYUT2Yb7KnUa8vgB5iLyT96E9pNxJMpHnbFr5E=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=ljXpdzd/QWZVuWmAjgvay+GWIEDwV/EV9ov0mkp46VmvO5c+PX29/Vv617UujyGiyyYgKm5r0QTqo94Y1KSNnzGU1qrJQ1j/EH6nysNSF1nPMdIkvAMLENO/MsphKyhj+oZR9Gxi0Ia+kv5TW37cFnBPYSkMD0GdCkl1TI2aEng= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rbyMH-0000QC-Pq; Mon, 19 Feb 2024 08:46:37 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rbyMH-001bHr-Ai; Mon, 19 Feb 2024 08:46:37 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rbyMH-007bvR-0n; Mon, 19 Feb 2024 08:46:37 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Thorsten Scherer Cc: Pengutronix Kernel Team , linux-kernel@vger.kernel.org Subject: [PATCH 0/4] siox: Move some complexity into the core Date: Mon, 19 Feb 2024 08:46:28 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Developer-Signature: v=1; a=openpgp-sha256; l=1298; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=JfG0uoYUT2Yb7KnUa8vgB5iLyT96E9pNxJMpHnbFr5E=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl0wdV5KoOVMYV9bbk4yCGhmy4C2xnPdssud5f9 chkfG9LUUaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdMHVQAKCRCPgPtYfRL+ TsOWB/0fqeYeL2v7P/VZWwf3v5HhWDGKQVZlro6QvTILEh9pD435WgE9aJpUxQ8xJUovs3EB+1j bxO+AxoKOfKgbDR4wsoPKDTPire/NnQghaxNthlIGXxHqXjqz0DBXpig6jKvk7DAjqalQxFctu+ oqOUB9mDRSvLBxEwyVQ/1/+h0n+Z4iE2O3mNEtOKpZSNO0Cfz1Nsl4FFlMzStyupFl2klJ5wPl0 DEzFXau5B5PSJOKTQfTpFBS+As0FDDdmckAKtzgY5VOfXRdah0UWwp/y1iXnFjcxVDC9LBGWXm2 +HTRtSqPv3HG3zklFqNpevbFw8aTBbez/tMtqqxlsfUL7WNs X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Hello, the reference handling in siox is a bit strange. With siox_master_alloc() to get a reference on the master that is passed to the core calling siox_master_register(). So until siox_master_register() is called successfully the driver has to call siox_master_put() in the error path, but on remove siox_master_unregister cares for that. While that technically works, it's unusual and surprising to use. This serie's first patch cleans that up and then introduces devm functions to make it even easier to use. A nice (and intended) side effect is that the gpio bus driver gets rid of it's remove callback, so I don't have to adapt it for my quest that changes the prototype of .remove(). Best regards Uwe Uwe Kleine-König (4): siox: Don't pass the reference on a master in siox_master_register() siox: Provide a devm variant of siox_master_alloc() siox: Provide a devm variant of siox_master_register() siox: bus-gpio: Simplify using devm_siox_* functions drivers/siox/siox-bus-gpio.c | 62 ++++++++++++------------------------ drivers/siox/siox-core.c | 45 ++++++++++++++++++++++++++ drivers/siox/siox.h | 4 +++ 3 files changed, 69 insertions(+), 42 deletions(-) base-commit: d37e1e4c52bc60578969f391fb81f947c3e83118 -- 2.43.0