Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1701146ybz; Sun, 26 Apr 2020 02:22:52 -0700 (PDT) X-Google-Smtp-Source: APiQypIhjlATYhJoN07yUhs51tmuzDu1mH4/EgZksmMhfMPQh0DwKpjud0F4n5akJlD2bvdxnj4p X-Received: by 2002:a05:6402:684:: with SMTP id f4mr14739707edy.240.1587892972816; Sun, 26 Apr 2020 02:22:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587892972; cv=none; d=google.com; s=arc-20160816; b=lk4sYAmEHXpjBOtYJzjSt9fmoBlHdhqIItUeoRnF8xH+F/I35huRoZLZDt04CioghN Lhe38I55hw26vyLcyr/LoDKf31aDSPjn2aowq2fQdx3P4hMA+lYa9vHsGGCSs1wYxeZQ herBH/VDhrE/Ej19V6TvghFUFXq+i34ITjLYQd0/EA85wuF6kXvhJVs4C3inCLCV1y0g 3v7vkpcGzd+Tl4soJL6bm2OdK+wX2sq0/wul5pAXq/0JJYUwrecaZ0h6C9fgxcwvt0AI xNveHSG3YSOlfsSD7MRMUDb2sSjo5wEs42gXCItAwRZgrz2vnrstcxGq9K+dIN0YQ/8s 4kAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=6hQ0FsSv9PtPNzLad/ImWLAXQBaBJZp6Df5to0tE7AE=; b=csMkNeuwAf8VL+xjVpOpxn6I6pfyBXw8f15amqUcp4i72lBbE7C8hci1gVEBFpwIg4 PEBjHeLVJhs2fLukba+HAJCilCI67qe1VzXoVmO0IXruOHOkd9F47w3rvM5dUm0ih/Dn 5k8DlknyhO7Y0dVwIw49qvmjc1JP1Di3MkUjZPkK6AM0iC8NRtl3850o2rLHFzWjvauY HSwWYI63Ufrbgtfn08wmCrLef/BRszq/+fgkO4RKKZs/wIg+tH1pL6GUlYwJZaXqFBZe nWC/3lL4lbSUyKkPTu9c1yob8Wk/PTKs8eX1UEfXwm222GPiPSySQKe48zdlRCtfscF0 NGeA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m5si6188618edq.498.2020.04.26.02.22.29; Sun, 26 Apr 2020 02:22:52 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726149AbgDZJU7 (ORCPT + 99 others); Sun, 26 Apr 2020 05:20:59 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:35707 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725866AbgDZJU7 (ORCPT ); Sun, 26 Apr 2020 05:20:59 -0400 Received: by mail-ot1-f68.google.com with SMTP id e26so20843362otr.2; Sun, 26 Apr 2020 02:20:58 -0700 (PDT) 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=6hQ0FsSv9PtPNzLad/ImWLAXQBaBJZp6Df5to0tE7AE=; b=aUh1F5DwbU9XkJZlIcIi3D4H/wFjPqyGQIq9InaCKHQsSzGdf+VO3hW1TWoPiVSIJO HwTFYKJ4ZRDdeANtt1ajBAmm+rPPnPpw4djzoUKbf+mfkfgIIDWtdBmj8Y+eEV1iS83b 3Zp2D1bo8pCQDW6DPTzoXMDFWUAagPj4gyY6WpEnOYphg7P6rQ0K4l8HRwWkBZaeV9Rt By61noCuG7rHXicRCqpPcBaSn8TgY+IxalCyWcioTA/ceVaehAKclDTczh/2rh3ZmrOs cDy/XCHwZPcWysEPcDRPuRDv/RN/S1yXOJe9lAaEW+assCGKwpCCnlVgi47p8AH7Biz6 5yQg== X-Gm-Message-State: AGi0PuZwrYZXrRHy6aOe5QKfPm5BCuqORvQdFhRFzUTn4KMgQKzRv16j vrcho5Wi6z53t0LUezZ3XgdUb0DA9/qSJButXi8= X-Received: by 2002:a9d:7990:: with SMTP id h16mr8510307otm.145.1587892858245; Sun, 26 Apr 2020 02:20:58 -0700 (PDT) MIME-Version: 1.0 References: <20200425044655.166257-1-davidgow@google.com> In-Reply-To: <20200425044655.166257-1-davidgow@google.com> From: Geert Uytterhoeven Date: Sun, 26 Apr 2020 11:20:46 +0200 Message-ID: Subject: Re: [PATCH] gpio: of: Build fails if CONFIG_OF_DYNAMIC enabled without CONFIG_OF_GPIO To: David Gow Cc: Linus Walleij , Frank Rowand , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi David, On Sat, Apr 25, 2020 at 6:47 AM David Gow wrote: > The symbol 'gpio_of_notifier' doesn't exist without both CONFIG_OF_GPIO > and CONFIG_OF_DYNAMIC enabled, but is referenced when only > CONFIG_OF_DYNAMIC is enabled. > > This broke building with 'make ARCH=um allyesconfig': Right, so you have CONFIG_OF=y, but CONFIG_OF_GPIO=n, as the latter depends on HAS_IOMEM, which is not set for UML. Interestingly, the latter dependency claims to have been added because gpiolib-of.c uses ioremap()/iounmap(). However, it seems to have never called ioremap(), only of_iomap() and iounmap(). of_iomap() itself is available, as it depends on OF_ADDRESS, which depends on HAS_IOMEM || UML. Interestingly, of_iomap() calls ioremap(), without a dependency on HAS_IOMEM? So perhaps the dependency of CONFIG_OF_GPIO on HAS_IOMEM can be dropped these days, solving this issue as well? > --------------- > /usr/bin/ld: drivers/gpio/gpiolib.o: in function `gpiolib_dev_init': > ./drivers/gpio/gpiolib.c:5293: undefined reference to `gpio_of_notifier' > collect2: error: ld returned 1 exit status > --------------- > > Fixes: 63636d956c45 ("gpio: of: Add DT overlay support for GPIO hogs") > Signed-off-by: David Gow Anyway: Reviewed-by: Geert Uytterhoeven > --- a/drivers/gpio/gpiolib.c > +++ b/drivers/gpio/gpiolib.c > @@ -5289,8 +5289,9 @@ static int __init gpiolib_dev_init(void) > gpiolib_initialized = true; > gpiochip_setup_devs(); > > - if (IS_ENABLED(CONFIG_OF_DYNAMIC)) > - WARN_ON(of_reconfig_notifier_register(&gpio_of_notifier)); > +#if IS_ENABLED(CONFIG_OF_DYNAMIC) && IS_ENABLED(CONFIG_OF_GPIO) > + WARN_ON(of_reconfig_notifier_register(&gpio_of_notifier)); > +#endif /* CONFIG_OF_DYNAMIC && CONFIG_OF_GPIO */ > > return ret; > } Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds