Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1035567pxk; Fri, 25 Sep 2020 04:41:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGmf6wAFOyLQEt/P9qXJGtTbFYpDgAZm3BkZNuYR9zzoxDe6tx/Usr2SzzreA8B+Rp94Aa X-Received: by 2002:a17:906:4d97:: with SMTP id s23mr2342700eju.157.1601034115175; Fri, 25 Sep 2020 04:41:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601034115; cv=none; d=google.com; s=arc-20160816; b=IvLVN/Gpj6hShexRDTHw/1lbMAWIgwwB4CLs62cg+aeESZt7xjTLCVyJpXwQLjnAzy xKS42tO8VJ3JyxPPwjmOdDMoiqdUCICDB6bwllaeIku+FSAUgy1ExfadnY7uTrcmSPgv uu6r4eDH+OvkICy/nnQFW0+BgX0FXQUzWVlDHQzb4bpLgfKXhRRG9ZQuNbCJButWp84a KJa1Iw4CkcYGeFvLDhBScNH/ilDBpWrpS1TdVPesctUtIrU8EyU3FTGKqDWU9JxSnbe+ HtDBVmPuFATgTAaDhOuJ/xZV8VbxwnSO09+EdKQfH+2PTwfpwaxVXZNNfKMPVFY4t76f GA4Q== 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=bibwz6xtXc59LlPlbNqZb06QG0WOc82EPNG/m8AOWgM=; b=eKcR+gYCzUW27aZw8fSi0sz83DNiR+Hdu59DtgPN4rWFlbis3P7OJidGCAF00I70l8 Ttv4Mi8wCed7DLazyH/5yOIMf/Cx6Fy1ot3Acfk00CPn6aKS8366huTVZM3FXcKTlxm/ 0VbL1Jp+mttD9UrqHv6WcLyt9/GL8BOSfqxT998iPHw3TxGdPQXmtHbekCVLrnPy3Rjf EV1XCcBJ8+Ba3l9Nj4h5kOnhWV2/ERW1pJ3g90sa3ylKGGCiWV5ezRm3F0w/etjI46U3 jrS255mWZ3WC2hNlX+hm3zUxZD5mj7wCpPp4PPHTxQyJ49bGVF/eaR3y3G9uopNDceYm C/UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b="dSc/KCtz"; 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 y4si1555665edt.161.2020.09.25.04.41.32; Fri, 25 Sep 2020 04:41:55 -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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b="dSc/KCtz"; 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 S1728315AbgIYLkW (ORCPT + 99 others); Fri, 25 Sep 2020 07:40:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728158AbgIYLkW (ORCPT ); Fri, 25 Sep 2020 07:40:22 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28E5EC0613D4 for ; Fri, 25 Sep 2020 04:40:22 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id nw23so3206774ejb.4 for ; Fri, 25 Sep 2020 04:40:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bibwz6xtXc59LlPlbNqZb06QG0WOc82EPNG/m8AOWgM=; b=dSc/KCtznv2Nneu9E0L4E6GZC4phzWtLtucZD26WfnjbrQqAVDDyDuLH3ReTVHBRrb j9UOuSPctci4XvnfIEs3V4w0RfmwW+h9FfXeORqfzJEEPLqMSC9/BQXVOvrl2SmZknhE yrvruWYm18xxeI13FqyzFRWrPmHrWCDerMMLvrehr3rBZgtnhtPEmuc1iwvnUHpXMwK1 7zbGq7zUD7+0aMDo1TJVn1OsQf7wOz2xb1ftrwHos58uzo6ZMvFZiTYVaB9BXnP355FS ySdfqnrSSQXsBoSUnyr1hKbRqD9HG805rkMwEVMcPRiU33N7c2sD+9pphRyaHk/wxClx JAEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bibwz6xtXc59LlPlbNqZb06QG0WOc82EPNG/m8AOWgM=; b=kMFrah3gYQNnCxkDXeE04ZXSN95qwu93AO56A9MpwvHiJ1JDh64GUJWmAopzpX+ci9 7KBs22SpHivcegLFG1X2E79FaE+sa0WMUkI135tLkNKQ44I6KXI/5qPgmZ+Z1Z6Y9Kom neu6XJ/TsVxrvVL2g1WkOxwl6P+D26V0Gmgp6eOR5YjXUF+6knhx4hSpfhiCkwYEEHNo UHEj6T7GgkbWlto7rnDGAcWntfOmzk0THVFr3E9huJUkSNUDfVxBi0P5emA3cjyRCabR 0QpCshkBCOdM1GbzRpWhcNjzXDrhpHfrVUb5OupfHDgW/8EedwQ7k9ckPjx/HgCgAVzN ossA== X-Gm-Message-State: AOAM533q21hzfbqAzTW8xW0TCRNMk/YDO7FJbfj8SOLpAqYE/ScwrmsR Ax3xUanPrSnVnPnICpgwfB5fXgaDunbmbrDrvDq71A== X-Received: by 2002:a17:906:49c6:: with SMTP id w6mr2170357ejv.445.1601034020713; Fri, 25 Sep 2020 04:40:20 -0700 (PDT) MIME-Version: 1.0 References: <20200924113842.11670-1-brgl@bgdev.pl> <20200924113842.11670-9-brgl@bgdev.pl> <20200925090329.GZ3956970@smile.fi.intel.com> In-Reply-To: <20200925090329.GZ3956970@smile.fi.intel.com> From: Bartosz Golaszewski Date: Fri, 25 Sep 2020 13:40:10 +0200 Message-ID: Subject: Re: [PATCH 8/9] gpio: mockup: use the generic 'gpio-line-names' property To: Andy Shevchenko Cc: Bartosz Golaszewski , Linus Walleij , Jonathan Corbet , Kent Gibson , linux-gpio , linux-doc , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 25, 2020 at 11:03 AM Andy Shevchenko wrote: > > On Thu, Sep 24, 2020 at 01:38:41PM +0200, Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski > > > > GPIO line names are currently created by the driver from the chip label. > > We'll want to support custom formats for line names (for instance: to > > name all lines the same) for user-space tests so create them in the > > module init function and pass them to the driver using the standard > > 'gpio-line-names' property. > > ... > > > + if (gpio_mockup_named_lines) { > > + line_names = gpio_mockup_make_line_names(chip_label, > > + ngpio); > > + if (!line_names) { > > + platform_driver_unregister(&gpio_mockup_driver); > > + gpio_mockup_unregister_pdevs(); > > + return -ENOMEM; > > + } > > > + properties[prop++] = PROPERTY_ENTRY_STRING_ARRAY_LEN( > > + "gpio-line-names", > > + line_names, ngpio); > > Forgot to update GPIO_MOCKUP_MAX_PROP? > No, there are still three properties: chip-label, nr-gpios and gpio-line-names. Same answer to patch 8/9. > > + } > > ... > > > + kfree_strarray(line_names, line_names ? ngpio : 0); > > Perhaps you may check for NULL pointer in the kfree_strarray() and drop ternary > here? > I did in the previous series and you told me to not to. :) Bartosz