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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8206E7B5F9 for ; Wed, 4 Oct 2023 11:59:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233033AbjJDL7r (ORCPT ); Wed, 4 Oct 2023 07:59:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232936AbjJDL7q (ORCPT ); Wed, 4 Oct 2023 07:59:46 -0400 Received: from mail-vs1-xe36.google.com (mail-vs1-xe36.google.com [IPv6:2607:f8b0:4864:20::e36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF6A8A1 for ; Wed, 4 Oct 2023 04:59:42 -0700 (PDT) Received: by mail-vs1-xe36.google.com with SMTP id ada2fe7eead31-45456121514so1028163137.0 for ; Wed, 04 Oct 2023 04:59:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1696420782; x=1697025582; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=6AACATPPHgIuz8FxZ7eCyvrDEuOEhlDx+Kvd4JOYuOA=; b=mAQOrt8gTZi0vq7sO1Xt+yd+As6o+i0usTWDB+j7z0PqkPrl5peGoHXfK+Mr/tWL9G FHtVkskJtcJbXsyxZ+V04CiyWyZgEo/WNozbtjd/7sjL5/f+iagaILqHbv8TJaFtlfVL P9PPfqJ5pV489Cz0iNVmumBfhlYlbRC5/WnnxDUfjSpnw+A2pC7hmFGVy4pzKIjhYfCB Ai7ymdGxKduCjHdvM4J7LvVkrdgcBUNMI5GVj0YxqFq4mIJAhVHbrlt4n+fCGQLtvMTN 7JIbIsOPRF5yMci2nmdSF8FN82PecXEaZ13QnRAXiaM3Eiq9Q8zxtfqkQSjBeDJ9VMig 22Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696420782; x=1697025582; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6AACATPPHgIuz8FxZ7eCyvrDEuOEhlDx+Kvd4JOYuOA=; b=mg83H7YWn8kh6YC6ePCs9b2bup/3AqlFV5RNrBI3X/n5fqU0tc3XKFRekPXaFikwmH KSQT1cW9vwDMk6fgvZlbVOpWlkCTBIZXwzMi93Ou4Erx8t8LFeCJjHuk9Pb/rCsyavcP C0mFy0O5j0OoR4YdubRpxRyKZvMC7koky3iIyYLzE7OpfHZl5S9WGxaWnAONtALKnPHV yRcN3aeo9su5ZdD3+sBHTFDkPMPAdpkgLZGd+qDFyMTfaK/upoErgTk7c9UOXLs6RyD+ fMiWfJLpe3O+lsQzUbqOEhThbHDCyZPRMSRn9K+5KOhc2lnD6233lZ/RnRiVBJbG8YeZ uBgg== X-Gm-Message-State: AOJu0Yy8Kz6tcP+ZhqIT7tUZutwnqbpogmwgLAgTMyFzw4EF4AgSkJkE vfmUNMXaM1pPMxVQwa7/7yz4euYA392mKl6ZgLFk2w== X-Google-Smtp-Source: AGHT+IHumK2wxKHooMcCivaS2pM5etsFaTr9cIpwm6I5vcIaNG/mZmLCE1Sz7hn/phh+XU0GX2azNlHCgSET25mhNNk= X-Received: by 2002:a67:e3ab:0:b0:452:5798:64bd with SMTP id j11-20020a67e3ab000000b00452579864bdmr1197006vsm.35.1696420782057; Wed, 04 Oct 2023 04:59:42 -0700 (PDT) MIME-Version: 1.0 References: <20230905185309.131295-1-brgl@bgdev.pl> <20230905185309.131295-16-brgl@bgdev.pl> In-Reply-To: <20230905185309.131295-16-brgl@bgdev.pl> From: Bartosz Golaszewski Date: Wed, 4 Oct 2023 13:59:31 +0200 Message-ID: Subject: Re: [RFT PATCH 15/21] arm: omap1: ams-delta: stop using gpiochip_find() To: Aaro Koskinen , Janusz Krzysztofik , Tony Lindgren , Russell King , Mika Westerberg , Andy Shevchenko , Linus Walleij , Bartosz Golaszewski , Dipen Patel , Thierry Reding , Jonathan Hunter , Hans de Goede , Mark Gross Cc: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org, timestamp@lists.linux.dev, linux-tegra@vger.kernel.org, platform-driver-x86@vger.kernel.org, Bartosz Golaszewski Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Tue, Sep 5, 2023 at 8:53=E2=80=AFPM Bartosz Golaszewski = wrote: > > From: Bartosz Golaszewski > > gpiochip_find() is going away as it's not hot-unplug safe. This platform > is not affected by any of the related problems as this GPIO controller > cannot really go away but in order to finally remove this function, we > need to convert it to using gpio_device_find() as well. > > Signed-off-by: Bartosz Golaszewski > --- > arch/arm/mach-omap1/board-ams-delta.c | 36 +++++++++++++-------------- > 1 file changed, 17 insertions(+), 19 deletions(-) > > diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/= board-ams-delta.c > index 9808cd27e2cf..a28ea6ac1eba 100644 > --- a/arch/arm/mach-omap1/board-ams-delta.c > +++ b/arch/arm/mach-omap1/board-ams-delta.c > @@ -560,22 +560,6 @@ static struct gpiod_lookup_table *ams_delta_gpio_tab= les[] __initdata =3D { > &ams_delta_nand_gpio_table, > }; > > -/* > - * Some drivers may not use GPIO lookup tables but need to be provided > - * with GPIO numbers. The same applies to GPIO based IRQ lines - some > - * drivers may even not use GPIO layer but expect just IRQ numbers. > - * We could either define GPIO lookup tables then use them on behalf > - * of those devices, or we can use GPIO driver level methods for > - * identification of GPIO and IRQ numbers. For the purpose of the latter= , > - * defina a helper function which identifies GPIO chips by their labels. > - */ > -static int gpiochip_match_by_label(struct gpio_chip *chip, void *data) > -{ > - char *label =3D data; > - > - return !strcmp(label, chip->label); > -} > - > static struct gpiod_hog ams_delta_gpio_hogs[] =3D { > GPIO_HOG(LATCH2_LABEL, LATCH2_PIN_KEYBRD_DATAOUT, "keybrd_dataout= ", > GPIO_ACTIVE_HIGH, GPIOD_OUT_LOW), > @@ -615,14 +599,28 @@ static void __init modem_assign_irq(struct gpio_chi= p *chip) > */ > static void __init omap_gpio_deps_init(void) > { > + struct gpio_device *gdev; > struct gpio_chip *chip; > > - chip =3D gpiochip_find(OMAP_GPIO_LABEL, gpiochip_match_by_label); > - if (!chip) { > - pr_err("%s: OMAP GPIO chip not found\n", __func__); > + /* > + * Some drivers may not use GPIO lookup tables but need to be pro= vided > + * with GPIO numbers. The same applies to GPIO based IRQ lines - = some > + * drivers may even not use GPIO layer but expect just IRQ number= s. > + * We could either define GPIO lookup tables then use them on beh= alf > + * of those devices, or we can use GPIO driver level methods for > + * identification of GPIO and IRQ numbers. > + * > + * This reference will be leaked but that's alright as this devic= e > + * never goes down. > + */ > + gdev =3D gpio_device_find_by_label(OMAP_GPIO_LABEL); > + if (!gdev) { > + pr_err("%s: OMAP GPIO device not found\n", __func__); > return; > } > > + chip =3D gpio_device_get_chip(gdev); > + > /* > * Start with FIQ initialization as it may have to request > * and release successfully each OMAP GPIO pin in turn. > -- > 2.39.2 > Patch applied, thanks! Bart