Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3569143pxb; Fri, 5 Nov 2021 18:36:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz935x0QA025BzVs2neMAltPhLsFLTv9MPk7UlGAtU0D8XxXhpu+JxuCvP7OE+2AbmzfffB X-Received: by 2002:a05:6e02:216e:: with SMTP id s14mr16613299ilv.76.1636162580265; Fri, 05 Nov 2021 18:36:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636162580; cv=none; d=google.com; s=arc-20160816; b=tVuJD0TSTFDcJAejGs3CeZsHBygztIGm6A0Bs5/IkEZZYCG76PuX/bbY9C/wL0Gcom Lllhn1ApLvqqJmadWKMO7v0vwGQ5zXbPu0uSPE/McjIasro4ZWYpLkeAtYPv+jzS+qwz s0q8e1mrm/waQA6zhg0qwwFhqvIVgNiICTM4gfwRipDHySj794rx3eYHXbodxUYM1IkG ZKOaqLbvvxOhjlqRVJJmOmEKeDgnPWR1DiuEhN45NH7emixealARvYh/YJqDZTVl3aVJ ahIVQIGem4pFtlNftCHrw8/HdfN25bfiif+nfYI0bOiangDxXtswcLDvRZXLcz8n0EgY qc3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :dkim-signature; bh=+ukrhMc54po+ZfQV2fTWAEE2CL/83wEHkoyByYstNRw=; b=Z8iClf+Blmqob7nasEbo/QA33CmSxofX+oSeFTPRqFQHHGxydx80XKlmoHBZBL8/Up +jw7/wLKipbosTYtKaObRJEX20pse1oWD2MsyUyljLiD4KmqsxrV3vCarmCbk8zto5KQ IeKxKhqYcvRM0F+0F3mw+/WhS1zmpnwy8pCadOVvVkPOwh+dXg84pXFLRIrICm8N3Wnz /bRA0kdxDb1qowGi71GWAIVOFMj28xSc4BI1uiVzkFwmYX6IdlVC9tlUNck2r9843ypQ /3K7HDyZzQlUTthD5bqCMfFkZX8XFx51sTnEg+oU2EMDM2gEC8xgjXNIfzay2FBd9k4/ 1uYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=GisVo0g7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y4si19987370jat.0.2021.11.05.18.36.07; Fri, 05 Nov 2021 18:36:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=GisVo0g7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230369AbhKEXWe (ORCPT + 99 others); Fri, 5 Nov 2021 19:22:34 -0400 Received: from ssl.serverraum.org ([176.9.125.105]:43731 "EHLO ssl.serverraum.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229745AbhKEXWd (ORCPT ); Fri, 5 Nov 2021 19:22:33 -0400 Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 5402222247; Sat, 6 Nov 2021 00:19:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1636154391; h=from:from: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=+ukrhMc54po+ZfQV2fTWAEE2CL/83wEHkoyByYstNRw=; b=GisVo0g7LTEr/fa44vtS/Dv/YWGkBQ2o2qKsZwez0J11m8tPhzWRtbGVS85ABgDizYpDQY ovorPpoYHafmxmL+W+GA7bkx5xJ4vria+Dt34veOqhppgp+hOlXMzSrL7xSt9LZU3pA2n5 /VOURDLKkTvuL7h7WIOPVtDvqoEzR0w= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 06 Nov 2021 00:19:51 +0100 From: Michael Walle To: Robert Marko Cc: Andy Shevchenko , Linus Walleij , Bartosz Golaszewski , Rob Herring , Lee Jones , Philipp Zabel , "open list:GPIO SUBSYSTEM" , devicetree , Linux Kernel Mailing List Subject: Re: [PATCH v7 2/6] gpio: Add Delta TN48M CPLD GPIO driver In-Reply-To: References: <20211102165657.3428995-1-robert.marko@sartura.hr> <20211102165657.3428995-2-robert.marko@sartura.hr> User-Agent: Roundcube Webmail/1.4.11 Message-ID: X-Sender: michael@walle.cc Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 2021-11-05 12:34, schrieb Robert Marko: > On Tue, Nov 2, 2021 at 8:28 PM Andy Shevchenko > wrote: >> >> On Tue, Nov 2, 2021 at 6:57 PM Robert Marko >> wrote: >> > >> > Delta TN48M switch has an onboard Lattice CPLD that is used as a GPIO >> > expander. >> > >> > The CPLD provides 12 pins in total on the TN48M, but on more advanced >> > switch models it provides up to 192 pins, so the driver is extendable >> > to support more switches. >> >> ... >> >> > +static int tn48m_gpio_probe(struct platform_device *pdev) >> > +{ >> >> > + const struct tn48m_gpio_config *gpio_config = NULL; >> > + struct gpio_regmap_config config = {0}; >> >> I don't see a point in assigning these variables. > > Hi, > The NULL one isn't required, but the regmap one is, otherwise the > devm_gpio_regmap_register call will > return -EINVAL. > > It will fail here: > https://elixir.bootlin.com/linux/latest/source/drivers/gpio/gpio-regmap.c#L209 > > I see that Michael Walle who did the GPIO regmap uses it as well in > the Kontron CPLD driver. > Michael, can you shed some light on this? I guess this was already clarified? Because you don't set all the properties of the config you have to initialize it. Otherwise anything could happen. -michael