Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp1386974imp; Fri, 22 Feb 2019 02:26:14 -0800 (PST) X-Google-Smtp-Source: AHgI3IY3boqoEcieN1nbb4aOr3FA8HwIFx5h8bd7v2PsB/b6D0UdiQ4bQQFqCJMdPm1ogOhfhheB X-Received: by 2002:aa7:9090:: with SMTP id i16mr3399919pfa.85.1550831174356; Fri, 22 Feb 2019 02:26:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550831174; cv=none; d=google.com; s=arc-20160816; b=dLMdqrkJ+q8A7uVnf2eweL8idtK0iTRpvOyVH5SD9k+KAgnnJOuXM2xocO451YhE7X m/5in9LB9eo9RlOvAwk1X+bVr76sSX88sqXOuZCqRXEzVSlR+utSkT+pNa36F/hZ8PdU 3f1TytOlApalAzJ0ZITLXNpIADQWLcsZrhJ+B9vMIp9vUBP5aUej0I/s9pnUglP1bDAV irgtGiueZtn0qOXw10+apy/Y6JpIlRjDYmp6jGEiyO2KF/gOudvohme60TW1d4yi+ql4 lrAR9WHo1AppdK89OaAYNZWDnh67gH7s3fOehXOnbhMtXwqxLuhxZ8/DvWdo/JYDCJ15 4Maw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=KelViqTFxcQnVlbfcwA3gjNLj+2tpIjM8hT3+oWvqIQ=; b=1EW+5UXS9GyO/c0ROGrWipgv+e37186wRYXMrZ/1lXFMnSerGR4drJkvl7ZIRyXgO+ Y28hsKp2YF1Z9VduFySheeqr6Wm5c5MGmGwMiz7Hj3rDc/mf2ppyOw1Rb9oZPfiiCf4h ouhvuIcFu+G1/vkS3KqdHqT6XBeK4NLSbdPbgHJ78f25QAbHf8qlQdgHymX+VR1R4uSF iwoODbBWMj8SbQNtvEYFf47MLatKmbifaN6iX04Cx72OMrQWYgHhPLhfrysILzVP7DfV 1sLnr1CtBMPe7oQMCGxngiESob/AG+VlMqu7jqKatwdW/B29oG5BkPj8CIFPWMwhsaMA 3qog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nb6OVA01; 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 y72si1036983pgd.398.2019.02.22.02.25.58; Fri, 22 Feb 2019 02:26:14 -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=nb6OVA01; 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 S1726971AbfBVKZJ (ORCPT + 99 others); Fri, 22 Feb 2019 05:25:09 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:44615 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726269AbfBVKZJ (ORCPT ); Fri, 22 Feb 2019 05:25:09 -0500 Received: by mail-pl1-f196.google.com with SMTP id c4so897508pls.11; Fri, 22 Feb 2019 02:25:08 -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:content-transfer-encoding; bh=KelViqTFxcQnVlbfcwA3gjNLj+2tpIjM8hT3+oWvqIQ=; b=nb6OVA01liAl8XiwhAD3wZzgHvFZhdhUB50vC63r0ucW6wov4IcLABz+CCIq5UBgYV tIC7/ieNGH8yMF064Dkdbjhifv336eFtqfKvA+zbGOGSRHaacFKUK1hjST5PYAE25n4V 4kuB3scfPgOSOKG2+hkD0NjXKXMxNMlCOqoj/SLsW6g5RWdM7vlclrkp3l4fkvkyvrBz aBXrbWUMD1aioQk8vkZuLXxcAT7i8wyHWUrv/tyEAkboYuJZrOhVuU6hTyr2qu9l0Sdb sGFgoEqX0o8HUQSRkBIn4QCp/vgHQQEkOTPFxMjJAThigvhE5KX1jvdG+15SqzU2c67P rTmA== 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:content-transfer-encoding; bh=KelViqTFxcQnVlbfcwA3gjNLj+2tpIjM8hT3+oWvqIQ=; b=Msi3/YZcJeKd6ymX0q47D+YwLToT5kcDs5Qxm35Gj0ndmRMUKuenqwYZqF8WYEl//T vHTfIBsM1aFaAeHiomx3D+aiU86VQAU4VeRXDrQS9eDJ1hK03dKjmGc1w0CXIz9vo9k8 PTOoTcx9eHWnuCdpq1+x1TnKsgo+hOORaj5tsRUzgTJBaBrmSSajctADdxz/nJh2E4r/ wMEzQ+xhbO3wwX4NgP5jt7e02Hxto51FESUn0/pSbSl3Y6Vu+DUqrTRYVx6SQSXzvnU0 +npJuzXYK/NQqx6xqLoWrMg8+q9C12oqN/zoAnn5wTWjsQVSxAStckXSWttp+uP9E5CK fRWA== X-Gm-Message-State: AHQUAuZBJNM+fI/erhd4aA3olTDjQYhdzUjyFp+ooZxMSIhWW5364i41 DML6LepZBQXA12Z882yLPFiD+1qOfuEVGV+zRSs= X-Received: by 2002:a17:902:2468:: with SMTP id m37mr3462170plg.314.1550831108251; Fri, 22 Feb 2019 02:25:08 -0800 (PST) MIME-Version: 1.0 References: <20190221162627.3476-1-brgl@bgdev.pl> In-Reply-To: From: Andy Shevchenko Date: Fri, 22 Feb 2019 12:24:56 +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" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 22, 2019 at 11:04 AM Bartosz Golaszewski wrote: > > czw., 21 lut 2019 o 20:56 Andy Shevchenko > napisa=C5=82(a): > > > > On Thu, Feb 21, 2019 at 9:55 PM Andy Shevchenko > > wrote: > > > > > > On Thu, Feb 21, 2019 at 6:27 PM Bartosz Golaszewski w= rote: > > > > > > > > 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_devic= e *pdev, > > > > unsigned int index) > > > > { > > > > @@ -96,6 +97,7 @@ void __iomem *devm_platform_ioremap_resource(stru= ct 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 > > > > I followed the example of devm_ioremap_resource() which doesn't do > this - it just expects never to be used by systems without IOMEM. Okay, that's fine! --=20 With Best Regards, Andy Shevchenko