Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp422066pxh; Tue, 9 Nov 2021 12:54:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJxSVXSiuKt5RR/AetHlM3Nmt7e+i1sU14FiYicfzEwXyeyH6v0XH4W5gQkaLElYrfGvMnQ1 X-Received: by 2002:a6b:4e07:: with SMTP id c7mr6755054iob.23.1636491270679; Tue, 09 Nov 2021 12:54:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636491270; cv=none; d=google.com; s=arc-20160816; b=dEhiLXzVh6JeJRoodeuPFmXtC0F7k3xG3gnPF/LGYca0A8nO10Z6MI37AoI+lKVipd 3h+t5m88cPdg2XeK/pWKsD35+IyM4VB2j6UvG5V1sMErbYa6VSNjUzyaT2cIicNjyPf9 6bm2XXbcqnQ08DsmDgh0dG1Ux+Dt+XEQfeEc0skQLMzTxiAv2Y7/Ztavtp6RjvZK58NZ 6e9+ods5wbSWCdMmOIvqlAS05Vk+9FQNempThoaSyLw/hozdBhjEA8acFoyspnCkSC0s a1F5Y0PO7TTxhUP4QROjDExx0z7hIInwUeTF5XTamiym9X3mJBpoN+OtpqAYrSVlQRIk I4cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=zOIK0pY0+erpcI8zPo6QJaQ+g1dAYFq2ZtgG2KTZtWE=; b=XW8DfYt6yZ5C1cnlMbujTXU/9zfMv+5EHeEsoFX092zpicekJBBmweOmqLreK0cBJf We64HnkE2f2vBl5yzjxBuXb5B1jS+1cTN3KtVQPMUWX9/qi1mj6b0ymMZCU/W45b2vAJ GBl7ZbN8lGUnVeLn76MCLcUunb8zhs1wWiYjEr9BR+aQ415aUEoz5kuW3k4yQeQ5jKvY 5mnhsVMs/xjPfUfdjq9FRYnUFp6meTG3WelxHpiAgTdynFLOzfDRALQgg+54KYkTAa1T 9v6zwj042ga0g0qsxyvkLHGnZJwZrLQFZINaP6aBObcc/ff/jHM8bE20XfruLHDt8UXL d8sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sartura-hr.20210112.gappssmtp.com header.s=20210112 header.b=UDUz7sHZ; 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 a9si6599240jat.23.2021.11.09.12.54.16; Tue, 09 Nov 2021 12:54:30 -0800 (PST) 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=@sartura-hr.20210112.gappssmtp.com header.s=20210112 header.b=UDUz7sHZ; 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 S243870AbhKILUn (ORCPT + 99 others); Tue, 9 Nov 2021 06:20:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245646AbhKILUm (ORCPT ); Tue, 9 Nov 2021 06:20:42 -0500 Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1207C061766 for ; Tue, 9 Nov 2021 03:17:56 -0800 (PST) Received: by mail-io1-xd2b.google.com with SMTP id k21so5245991ioh.4 for ; Tue, 09 Nov 2021 03:17:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sartura-hr.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zOIK0pY0+erpcI8zPo6QJaQ+g1dAYFq2ZtgG2KTZtWE=; b=UDUz7sHZPURLvom+Kh2cDDrlO5XWNfmQNNIvqvsuWObekW/AyjTQPRwCAGRZEdsbU1 m+R+wFppRZml5QBTMSG+Mc0a2nHnjkC3XCqs1g8ZtmxAR3onKHek0b0+wML77fXBR+FZ qn019oc4sNY9FrbNyeD9tZegmL+TtUnVQoUUihme7zc1PTs8ORVdbgM8lOijUYZTXXUh m+6Wjz2ZNzWoJD3UDKiOQA+lzqGcYoUnVKe83h99xwP/xXxffcKicLx/xeztcnBWZXuq hMkO3iFOnT3Y/WAMa3elQP+IkZkye4rbazx0vm8SowYecVRoLjckBgGGaVx/pKW4LIYQ SKgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zOIK0pY0+erpcI8zPo6QJaQ+g1dAYFq2ZtgG2KTZtWE=; b=KSGXjW/P1parrclCEwderTlYMqy8+r6j/KPxTazxhgyVb8e4LtrWvTNV89oVIGHcXo ESGdOk1hJUjTQv+gXnlMw6actwPf0osPdrWk8auFShCSPx3atG6xXKIfS4ovoI1VIczZ ZadkkgAbTgB3EcFRUw5qyST/geJXYxdK8LzemVa9DXNv9/ovu09lpJ2HGYr4IFQK5oC6 nCipMfXQHZABJqvSCcOlb7yOY0meQIVnoyELIyCErFrzEDLuLTLz8Rnh2ioTJZN9znCE BQ663eHSMAMGhqZqWHIN4kc5n9o/WiGUbw9nvKnmHvsycZdjBB1L9+cdtFpCWImpnpv2 qt2Q== X-Gm-Message-State: AOAM5308f6gH+wiJ7vfwP5Qa1PogfVlQ+uCNBUhW2IFC1kHRZIWXOA3C /0v4ujehqMYSxohEqrfKumjP72gcAgTpnIBTeCxwNQ== X-Received: by 2002:a05:6638:1607:: with SMTP id x7mr4962927jas.27.1636456676433; Tue, 09 Nov 2021 03:17:56 -0800 (PST) MIME-Version: 1.0 References: <20211102165657.3428995-1-robert.marko@sartura.hr> <20211102165657.3428995-2-robert.marko@sartura.hr> In-Reply-To: From: Robert Marko Date: Tue, 9 Nov 2021 12:17:45 +0100 Message-ID: Subject: Re: [PATCH v7 2/6] gpio: Add Delta TN48M CPLD GPIO driver To: Michael Walle Cc: Andy Shevchenko , Linus Walleij , Bartosz Golaszewski , Rob Herring , Lee Jones , Philipp Zabel , "open list:GPIO SUBSYSTEM" , devicetree , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 6, 2021 at 12:19 AM Michael Walle wrote: > > 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. Yeah, I think it's clear now. Thanks, Robert > > -michael -- Robert Marko Staff Embedded Linux Engineer Sartura Ltd. Lendavska ulica 16a 10000 Zagreb, Croatia Email: robert.marko@sartura.hr Web: www.sartura.hr