Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp949395pxk; Fri, 25 Sep 2020 02:05:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwK1Wen1bZXXL7AvMv+r8fUqyuh6h4bovzP+/f1ZIlhZgSI0gqaZFTkuA/BHck/gIYPNJtU X-Received: by 2002:aa7:dc16:: with SMTP id b22mr222690edu.252.1601024704404; Fri, 25 Sep 2020 02:05:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601024704; cv=none; d=google.com; s=arc-20160816; b=dkvyGICHFE8phNIE9JaFPR8xca6ZygDEJiI6X9+9BNegguQPT9r1wLVT7YFVuy6/a3 T8QtieV8y942StClJfUH+FHhEibrdWmURD4ufDofU8iDiO9VoQuU9S9+WLKKALIgB2xQ OzAS5CcmNzpXlQQNvSGr2usBaEHQG2MsQFgdS8fyvWy4wZTxqnh1DCGL5EYpN9NoK0JT p6QU2KSeeyXjpfbLKcbAYkvQjABUGncbYGbCiz1V5u0THVfbAqmNaZoe4foEGxVy54M9 y7vEsY+37ZE7m1EFmuL9904uCOinbtwhdj8QyarpiOcq5YvHbnWCi/U1Z/a+/ZKaIe9s +ZhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=IJrUiOnbvmya6oEWh991WiD6ylHCmeI461oNAMOQO7U=; b=ETcwoeHcOS6Sp/xElcr2ExwCwU+Y8cr9cGGZNC7bf4yKDhWwyIuLmNPvgVhnX44kgL l9KXu/PmK63jKScLpJtPPnfMfbvH6+RuHHN93YWD0sRlKEkpcI/kBySrzbvxvi1nwMBS 9R7xGnmzLzxPzGoJoFPJoS19wNRu30lWA65zcRsW2tsvdby6bozzP/mzvr7l5LbFxjZU MFdL1YIaX/azItFAANVYVmh2sh9R2cjHv50LsNkkD54hUHvkKeEkOIkF3YXvpyfrxxHN vb1G/mkQW6Tf7QeVvk43r7Pd3T+1b0YkniGCng2Ld7qd8S4vy75EI1XOASZfcQzoPfoq RC5w== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o4si1408666eje.545.2020.09.25.02.04.41; Fri, 25 Sep 2020 02:05:04 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727812AbgIYJDg (ORCPT + 99 others); Fri, 25 Sep 2020 05:03:36 -0400 Received: from mga04.intel.com ([192.55.52.120]:53248 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727044AbgIYJDf (ORCPT ); Fri, 25 Sep 2020 05:03:35 -0400 IronPort-SDR: Y8UuPqOfRbxyYUs3u7hEXIMi/43KXTf55d80ZVlDzUKHTOG6n86tL08IMTQT5OrWnChj8opCAE 5GAZjXTqfQsA== X-IronPort-AV: E=McAfee;i="6000,8403,9754"; a="158862517" X-IronPort-AV: E=Sophos;i="5.77,301,1596524400"; d="scan'208";a="158862517" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2020 02:03:35 -0700 IronPort-SDR: F5gP2ztYRMaGx4eu4DU1djISTbNeaq9kk7IueOgojrYz4drfGoYSoVVYtwWaNEvvX0JMuqh28V qlLjhK2dbMQg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,301,1596524400"; d="scan'208";a="339423961" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga008.jf.intel.com with ESMTP; 25 Sep 2020 02:03:33 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1kLjdZ-001sXb-PK; Fri, 25 Sep 2020 12:03:29 +0300 Date: Fri, 25 Sep 2020 12:03:29 +0300 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Linus Walleij , Jonathan Corbet , Kent Gibson , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH 8/9] gpio: mockup: use the generic 'gpio-line-names' property Message-ID: <20200925090329.GZ3956970@smile.fi.intel.com> References: <20200924113842.11670-1-brgl@bgdev.pl> <20200924113842.11670-9-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200924113842.11670-9-brgl@bgdev.pl> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > + } ... > + kfree_strarray(line_names, line_names ? ngpio : 0); Perhaps you may check for NULL pointer in the kfree_strarray() and drop ternary here? -- With Best Regards, Andy Shevchenko