Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp6004113rdb; Mon, 18 Sep 2023 00:26:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEmwyN+GmCP84pMptr91KCYw0U97DPLdQki+H7UUaoXPZCxouZIGiosVuPLKS6FrF7ce2x2 X-Received: by 2002:a05:6870:472a:b0:1bf:607:e0f2 with SMTP id b42-20020a056870472a00b001bf0607e0f2mr9664848oaq.29.1695021971895; Mon, 18 Sep 2023 00:26:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695021971; cv=none; d=google.com; s=arc-20160816; b=qw/iKeG04AFGajngfs8TYrhnPf7sFY/VVhSpmCqqndivYdrg0Qfbgk1cRhxqDR54DD GmeD+oWkkq2FHT0e6yToKHSh90+mXF5NDI7RzpBwml1d790l66MzYJFuuIr+ugMqY8bR Jtlo+/+FQpSmAYlaEmEHkyYIGaHn0sAwDNvDN9XE1e3+QiIU0Elw6KmR2p0gUSr20N+E cT7BMEx29maDGT/JdsMJ2loE2ciWK4C33fuiTjwzdFTsdNELAMuqm9nKQFwdtIqMIYxC X1DLHJw0+vSK6PPMyhDJQnNgf48DBnmwus6JrPKozAJoh7428TMUXw1lRqDiIICl1+va trtw== 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 :dkim-signature; bh=7F1bkNvt0OAMzL3S03mIqTf0ITgG6LscBHlWY2XXsUk=; fh=w+fBQ8I5CPJm/649ua1THFWAkdLcQFsk/OHRFjWZWMI=; b=yTLAIbWKFq/LcRYfVqsN0i5afYAi6HImVvqe5VT/W5nhr4XC2qFrwZTNBG7gPF9HXU SBu9YSQkTJnKDwyediC7/YaUF8HHh/zYBnECnUDRzQRuTYXDSOWnIJTJ2OoPiVWIcstV iuVudT9u0Xg1gf5ULtzbaMrvv9Yq3cpt5Cr4bttpKpIu/ExMFw6dppOIPzits9+IrEP0 Fw3dLAXvOmwIQV6uKCcZpgl15JtSQYMj5azYhu4jSWbR5AU9CdFriFEDDDh0Grufc4vZ aHlobVHlpJZrLn4Z4E32mE0cqP78LGI3U+fLRq+yVuRPNBhNCz3mLjdlEWyewERKVW95 yaOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RHU5MeT1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id in23-20020a17090b439700b002691d885301si7719986pjb.0.2023.09.18.00.26.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 00:26:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RHU5MeT1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id B985281ED493; Mon, 18 Sep 2023 00:23:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240087AbjIRHXM (ORCPT + 99 others); Mon, 18 Sep 2023 03:23:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240213AbjIRHXE (ORCPT ); Mon, 18 Sep 2023 03:23:04 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E77B4AA; Mon, 18 Sep 2023 00:22:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695021779; x=1726557779; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=RIR2pEcEVhctX36Lz+WjGjwpXZAaBUs9ecXfeIMfP58=; b=RHU5MeT1X1nHRmQRkdXgo1RL/aztVIteiVyfqMOMj+hUlqlaRB/kdkcG /wYqCa5NMFBZASCfanGsL6nFY3IETr/G3LVfcjXUVxs8plEwCvEQFziRa 0t+ZEQG5KTaTzmplHSCh4YfIRYfK5ukE4ej4k2M+3LK0ahu/3PMbMWcLv +GaMg/GvvN/HucmMEu8pISvhQHVs2oqrRYt5QLbCUUV/0/Tj9Vfz1Stn+ lnkz3m8cmdM9m/8RUjul7KexbNjr5oFnM2qah5s3eayxY3Qf07aiTHJ4a +x8Tz+5wJ0w1nmup6hhzw7ewA4UhdL3ZStl3zyGCgkn1Jhj2ooMppj8p8 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10836"; a="382329771" X-IronPort-AV: E=Sophos;i="6.02,156,1688454000"; d="scan'208";a="382329771" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2023 00:22:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10836"; a="888927412" X-IronPort-AV: E=Sophos;i="6.02,156,1688454000"; d="scan'208";a="888927412" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga001.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2023 00:22:13 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97-RC0) (envelope-from ) id 1qi8ar-0000000EP4Y-2tCW; Mon, 18 Sep 2023 10:22:53 +0300 Date: Mon, 18 Sep 2023 10:22:53 +0300 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Linus Walleij , Mika Westerberg , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH v3 07/11] gpiolib: replace find_chip_by_name() with gpio_device_find_by_label() Message-ID: References: <20230915150327.81918-1-brgl@bgdev.pl> <20230915150327.81918-8-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230915150327.81918-8-brgl@bgdev.pl> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 18 Sep 2023 00:23:49 -0700 (PDT) On Fri, Sep 15, 2023 at 05:03:22PM +0200, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > Remove all remaining uses of find_chip_by_name() (and subsequently: > gpiochip_find()) from gpiolib.c and use the new > gpio_device_find_by_label() instead. ... > -static int gpiochip_match_name(struct gpio_chip *gc, void *data) > -{ > - const char *name = data; > - > - return !strcmp(gc->label, name); And this we had no check for the label being NULL... ... > for (p = &table->table[0]; p->key; p++) { > + struct gpio_device *gdev __free(gpio_device_put) = NULL; > + gdev = gpio_device_find_by_label(p->key); > + if (!gdev) { I haven't got the fix for gpio-sim, shouldn't we have the same here, i.e. definition being done together with the assignment when __free() is in use? > } -- With Best Regards, Andy Shevchenko