Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp822443imp; Thu, 21 Feb 2019 11:58:09 -0800 (PST) X-Google-Smtp-Source: AHgI3IZg4h0ZQI0lzDlUGnfBtChbGOxNolooqYreZpKkNp+rg78iw0ArEM5YEoNLnlH68iBxjDln X-Received: by 2002:a17:902:2e01:: with SMTP id q1mr271818plb.240.1550779089515; Thu, 21 Feb 2019 11:58:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550779089; cv=none; d=google.com; s=arc-20160816; b=SGfUVDreI5pTwr+zr84D1yX5YaQyzblgyNBYs9tMgOls7yyG1xNQrD7mKgPHfPtgHx vIjuZpDKWaUmn7GqYv4GUxw6GUcnqKpdRcqBeZNDjWk1u3iZVux1kHjhKn3L7mRRVpVo ZFyYe990cfVx+lYfsOZEwYIjRkgwYucayOzkyme1urpJXCGJlvHV74LqTH7tDLEhhQdq gRaQ9cpkZQoBxVOKeEE8FXSWSLtQpZYCKxdl5K/fHabFIJ1qific4fgdLn4ZC4f4GTdp zAn3N/65gZXGy7A+ch0gDC7nw5uWFNLcBmkk8c/xty2lK/9fmPnsfVExLhUx0vWkpQem sk+A== 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:dkim-signature; bh=7i81LMu7iyoZ9SjUACWlR9UwJhZVtJB3b/j0E1pxkGI=; b=r1ovZ3Nsp7pTbfjeK0rPav6AOmTGAS6vFtVbTFuHUll7zLrNHI0uYxlU4CNANbgdRD 1g1AR21ItC+qExHSYXh2kXy9gfaXY/oayBdOI4zWdD72vTyReN0y/R2DfPlxO95xhFdX n8BqeKkOXtwD+mLoOFLeqI2e9fb89bJAyNPYSIf9oMMvu/yohmX2l4lUK+LXn4rv00RL p3Zz0bk8NqzH1MMEEi8YuXagtgchSnx9qiEV4I66Ytt5NutYfGOz5fgNu2IvrtzWdDig ssLmKty9XOofe2VmCo/b1q9i7UV3oZ8SEJCY8MNCFuTMY1UJ7XXRCqG6nhoOLOXI2OsD NJJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Wf/NVQlB"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j11si23740170plb.253.2019.02.21.11.57.54; Thu, 21 Feb 2019 11:58:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Wf/NVQlB"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726713AbfBUT47 (ORCPT + 99 others); Thu, 21 Feb 2019 14:56:59 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:44604 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726220AbfBUT47 (ORCPT ); Thu, 21 Feb 2019 14:56:59 -0500 Received: by mail-pf1-f194.google.com with SMTP id a3so4425539pff.11; Thu, 21 Feb 2019 11:56:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7i81LMu7iyoZ9SjUACWlR9UwJhZVtJB3b/j0E1pxkGI=; b=Wf/NVQlBwhevaWq/ZxF/KzGK0tdGntOPbniI5pW4WAIJJV2x51eVLuW4zclVS2EH+5 fN3l/SvFDtm1ykfDOtg0kY54d4tJynKMAFRZaMQkRbrH7p4G2T7WuGAza2T1jtddrGjl Xich5lcBeGYQfFDZ5N/8GuKXqDP8396jjXpjx66jVeQ7jz10igSDBXbEEgTavEGlUUbz 2rNpP1BWNWOjgUp9wiemziWlPcSgfKiPQCd5MwBZcQvbW0K28dC+xU8VORugbfNVHPou TCMImrxd81w2RyPFAaYspff0dZBfMWDX/TIKuUrWGhLeK/Aeg/gY3uGZH8urUW9UYHJ7 PV+A== 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=7i81LMu7iyoZ9SjUACWlR9UwJhZVtJB3b/j0E1pxkGI=; b=OP3jvo9k7e8I8+/s0FbJF8zLwOQCh3wBYpPhH9J74lfMQaOGIo3xdHGDkMfZTn9JbH gMRrW1o1U5X8vWXLgbqA8nJtGr9cAE9sjZgPW0SkVE14PzNZEWBmDm0r/l9zWHXQntYH 9r2hqvRa2w3ZxeQHKp7pDCfrV3zwRsfQiy+BsILH5zilAlMsOZK7pq61zThTJ/nzhyRD s33f/nb1DvLjOMrL0Gsh7o8lFJvDg9N1eO2iqAKnQUjjUegXzznFNDyDu1l3ScA1BosR ML0QDSYpPmvjU5PQH3Bvaqchr/4K4PK/d9Ib7O3sBlS7OCucG1awVb0bp/SlwOEIDE3s bG1Q== X-Gm-Message-State: AHQUAuaK3FmxStAQeOUIAXPtuU8oCrJPkc9b8NJZlMcgQaDSzJJhirr6 61BCoYN38ezPEew3RorCmFQjiUuLMJThOUOuHEY= X-Received: by 2002:a62:864c:: with SMTP id x73mr238350pfd.49.1550779018880; Thu, 21 Feb 2019 11:56:58 -0800 (PST) MIME-Version: 1.0 References: <20190221162627.3476-1-brgl@bgdev.pl> In-Reply-To: From: Andy Shevchenko Date: Thu, 21 Feb 2019 21:56:47 +0200 Message-ID: Subject: Re: [PATCH] drivers: depend on HAS_IOMEM for devm_platform_ioremap_resource() To: Bartosz Golaszewski Cc: Greg Kroah-Hartman , "Rafael J . Wysocki" , Keerthy , Linus Walleij , Andy Shevchenko , Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , Bartosz Golaszewski 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 On Thu, Feb 21, 2019 at 9:55 PM Andy Shevchenko wrote: > > On Thu, Feb 21, 2019 at 6:27 PM Bartosz Golaszewski wrote: > > > > From: Bartosz Golaszewski > > > > We only build devm_ioremap_resource() if HAS_IOMEM is selected, so this > > dependency must cascade down to devm_platform_ioremap_resource(). > > > +#ifdef CONFIG_HAS_IOMEM > > void __iomem *devm_platform_ioremap_resource(struct platform_device *pdev, > > unsigned int index) > > { > > @@ -96,6 +97,7 @@ void __iomem *devm_platform_ioremap_resource(struct platform_device *pdev, > > return devm_ioremap_resource(&pdev->dev, res); > > } > > EXPORT_SYMBOL_GPL(devm_platform_ioremap_resource); > > +#endif /* CONFIG_HAS_IOMEM */ > > What about declaration in *.h? > > Perhaps you may just do this inside the function? #ifdef ... #else return ERR_PTR(-ENOTSUPP); #endif -- With Best Regards, Andy Shevchenko