{"id":2228712,"url":"http://patchwork.ozlabs.org/api/patches/2228712/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-gpio/patch/20260427-gpio-mmio-more-v3-1-fe1882351424@kernel.org/","project":{"id":42,"url":"http://patchwork.ozlabs.org/api/projects/42/?format=json","name":"Linux GPIO development","link_name":"linux-gpio","list_id":"linux-gpio.vger.kernel.org","list_email":"linux-gpio@vger.kernel.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260427-gpio-mmio-more-v3-1-fe1882351424@kernel.org>","list_archive_url":null,"date":"2026-04-27T08:47:57","name":"[v3,1/3] gpio: devres: Use devres parent if undefined","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"3cc7f6f4b60e1bc43e9b1a455976ea89071e1214","submitter":{"id":92050,"url":"http://patchwork.ozlabs.org/api/people/92050/?format=json","name":"Linus Walleij","email":"linusw@kernel.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-gpio/patch/20260427-gpio-mmio-more-v3-1-fe1882351424@kernel.org/mbox/","series":[{"id":501608,"url":"http://patchwork.ozlabs.org/api/series/501608/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-gpio/list/?series=501608","date":"2026-04-27T08:47:59","name":"gpio: Use generic MMIO GPIO some more","version":3,"mbox":"http://patchwork.ozlabs.org/series/501608/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2228712/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2228712/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-gpio+bounces-35541-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-gpio@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=Il1vcf0j;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-gpio+bounces-35541-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"Il1vcf0j\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"],"Received":["from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g3y0W3Rmtz1yJX\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 18:48:59 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id AE7C13019159\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 08:48:04 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id D54DA39FCD2;\n\tMon, 27 Apr 2026 08:48:02 +0000 (UTC)","from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 9977638759C\n\tfor <linux-gpio@vger.kernel.org>; Mon, 27 Apr 2026 08:48:02 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id 5027DC19425;\n\tMon, 27 Apr 2026 08:48:01 +0000 (UTC)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777279682; cv=none;\n b=gCbQ/2fonfKz+Ki2Cx/fKgqnqM/tW+1R2l5iMvpULk1qq2KH8vwmUuJ10fqt0sgYFk0uCzBonH33KXWDmaiBB8Bj5awUBJESiw5P7ti8rwSPxABHe5hc1Z+GlcR7Oy8dbrsmR1a78VqkLH39HqJ5voLZkGX0/jSSQdoDYeO/tIA=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777279682; c=relaxed/simple;\n\tbh=81HtaneFQeXSq5lvdKyynPLRJRD2vWzUCTFzQBLMjuM=;\n\th=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:\n\t In-Reply-To:To:Cc;\n b=YJVJ3Wa01eCvZo30bOMp4rPXB2mmaeWsTLmTARgZijSb6X2PKTL6mP64qEnXh4D414YurRV0tdT/I5Cbv3wC1GP9YaHuh+qnHDskI9FB6obxvjAe+XA7OQxbvHMe1PxuZEsfF3Xer4iaGC0UwFnEjwjc7ddb16gdi5mO5/w1vAc=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=Il1vcf0j; arc=none smtp.client-ip=10.30.226.201","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1777279682;\n\tbh=81HtaneFQeXSq5lvdKyynPLRJRD2vWzUCTFzQBLMjuM=;\n\th=From:Date:Subject:References:In-Reply-To:To:Cc:From;\n\tb=Il1vcf0jcqV+PxB5XGAjPpShjlkG5zuIqE9wm2WELzBflFxb9aAPomjAs2cAg/wBv\n\t 06uA/DENYjnDGQT5R+/geKueKdCO9Kj9TiLh6KjcPJEk9xVV5OBsjHMGcLkaA9mrKo\n\t AycI9+BavYpCuFiYf3jAe+66+KV530Oa6ZgHqC8mBUl2PfEcFpPnouSasf7IoT3G/7\n\t TLXDgX1W/06cnk389zZl4jj8jU4lQ4eYjNZhM5m7QeUPTcq98749MTv2kqJQsPtcKK\n\t Y6q5OF7IrIerqJsZs7bcZolKKpzKSf3SJOSDIzlZRpb5a8iJiRJPvtoBB7z7p3k/FW\n\t GkmYlWBM84kew==","From":"Linus Walleij <linusw@kernel.org>","Date":"Mon, 27 Apr 2026 10:47:57 +0200","Subject":"[PATCH v3 1/3] gpio: devres: Use devres parent if undefined","Precedence":"bulk","X-Mailing-List":"linux-gpio@vger.kernel.org","List-Id":"<linux-gpio.vger.kernel.org>","List-Subscribe":"<mailto:linux-gpio+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-gpio+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","Message-Id":"<20260427-gpio-mmio-more-v3-1-fe1882351424@kernel.org>","References":"<20260427-gpio-mmio-more-v3-0-fe1882351424@kernel.org>","In-Reply-To":"<20260427-gpio-mmio-more-v3-0-fe1882351424@kernel.org>","To":"Bartosz Golaszewski <brgl@bgdev.pl>,\n Mun Yew Tham <mun.yew.tham@intel.com>","Cc":"linux-gpio@vger.kernel.org, Linus Walleij <linusw@kernel.org>","X-Mailer":"b4 0.15.2"},"content":"From: Linus Walleij <linus.walleij@linaro.org>\n\nIf the user did not pass a parent in the struct gpio_chip\nthen use the device used for devres as parent.\n\nThis is quite intuitive and can help avoiding having to\nassign parent explicitly in every driver using devres\nto add the gpiochip.\n\nSigned-off-by: Linus Walleij <linus.walleij@linaro.org>\n---\n drivers/gpio/gpiolib-devres.c | 7 +++++++\n 1 file changed, 7 insertions(+)","diff":"diff --git a/drivers/gpio/gpiolib-devres.c b/drivers/gpio/gpiolib-devres.c\nindex 72422c5db364..2ec825ffab7d 100644\n--- a/drivers/gpio/gpiolib-devres.c\n+++ b/drivers/gpio/gpiolib-devres.c\n@@ -353,6 +353,13 @@ int devm_gpiochip_add_data_with_key(struct device *dev, struct gpio_chip *gc, vo\n {\n \tint ret;\n \n+\t/*\n+\t * We are passing the devres device here so if the user did not pass\n+\t * another parent, it's this one.\n+\t */\n+\tif (!gc->parent)\n+\t\tgc->parent = dev;\n+\n \tret = gpiochip_add_data_with_key(gc, data, lock_key, request_key);\n \tif (ret < 0)\n \t\treturn ret;\n","prefixes":["v3","1/3"]}