From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0E7FC433F5 for ; Fri, 5 Nov 2021 23:19:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C0DA061216 for ; Fri, 5 Nov 2021 23:19:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230063AbhKEXWd (ORCPT ); Fri, 5 Nov 2021 19:22:33 -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: devicetree@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