Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp1329065imp; Fri, 22 Feb 2019 01:05:15 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibw0IVm1vGrjZGT+DbH6AmZdo+W+DPDP0hLi4R3BKZQ/es3wUXN7NjFcIcIq5gOhU4t/T4w X-Received: by 2002:a63:584e:: with SMTP id i14mr3048424pgm.68.1550826315301; Fri, 22 Feb 2019 01:05:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550826315; cv=none; d=google.com; s=arc-20160816; b=biuFGGCA1Xyrd5G6B+ysP/qntSmOLjxmc6Qs/a6+OJlrp6xnnO79hRLSrm+9Q66aJa m/DeJQj+uTGo2ZefJiBlWY38vXtVSJy9G2oz6tyf0wfL/kSHJaErr7DR9CULSHekym02 9vxR5/PYYrA+TM9H4aOrj86d0D1GgFHZyGYccNU0/1qP/T/A3csBfaj4DCtvLvhrxQGv +NOI3knBgdA2UOICHWLHK2qaty7IGBBP6eTTmA/ku3hxLh8yJKow+zIJkVB9T1WksNps kd87NEAGK/VzmBLCGbqwmzkFap35GaC4HB0KfjzuEabZozVkdIiMksPWtNlzZGXZLN5Y duPQ== 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=hQ8CkzyGqK59D74CH8I4edWHR9SkpQ9HCgG7RFV5u4c=; b=oPTm9uxBI0s2JuqIQ1+jQlDfStLbyiZnJByggsupo3OR72/wBg65WFC/a8Drj/AOCE fJ31ryvlVZ8WRtWTKNjDilM4ftx9hCdmMaWuwApoPouZQo5OJmeIhwxDEUC/bnRKoKbq lr8xssrWkYYJaccUP4xNl6/k2JyOWjLtZMWdUE6Qub0S5O2H3DURgu3QBuE5RZg6rxrC lke8g0uhNJsLDoebAj4FXVdpFCoJ1KaUmKn2jZZL0i7Kxrpbgl+ruaN5aTqY1Z69TTIC psgFDAxzvLcHC9zhQINPH3IgkPbFZTeaFk6uyuPoJ9DKATbhto8iqetr0rdKI74h81mv ntcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=P8jYx2DE; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d63si928782pfg.40.2019.02.22.01.04.58; Fri, 22 Feb 2019 01:05:15 -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=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=P8jYx2DE; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726331AbfBVJET (ORCPT + 99 others); Fri, 22 Feb 2019 04:04:19 -0500 Received: from mail-it1-f194.google.com ([209.85.166.194]:51035 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726214AbfBVJES (ORCPT ); Fri, 22 Feb 2019 04:04:18 -0500 Received: by mail-it1-f194.google.com with SMTP id m137so2012877ita.0 for ; Fri, 22 Feb 2019 01:04:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=hQ8CkzyGqK59D74CH8I4edWHR9SkpQ9HCgG7RFV5u4c=; b=P8jYx2DEepv3/Ml54PcuR2/AeIAk9uLQ6RblLzNL9vp89DM6D4bK9dyK4yyPX666si eM3HNLj2LoLxGhqv9h0DDwzmb21yht5IrWqrSqsIdnOHx9lh8Wn6XdtWkwsQpeEX9miT 6qicooiLd8cFx4d0kQV4oWOBdSU/SKD/G4OFrc6dFjahXlmGwBc9en64QHcapmdN5VFR DvezSUesoT7xlRGZr6mkSTjtuyzCRDcVoZtF1uv183SUcTSdS66b14AwcOLinis2KApW GHPoAj4AhsrThL4kLkzylEo1/ULxxKMmVz/Nw3ErHWni3T9diryEnFC/FG2QaVluA4Tu 4pUw== 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=hQ8CkzyGqK59D74CH8I4edWHR9SkpQ9HCgG7RFV5u4c=; b=XqlxW+/5xjJhLj0rXP+GC/krg9ydzq0nZ5wW3+wLJ6UYd+2hVc0hr0RZSVk+3Uk1xK gMDYP2dp/wBcl8K3PXnTO3goerQI5sjGqhXujaY+Bhh9YeBpBJmG+6KUEI9jEAMYMD1O iMDBv4+eZzZOpqHElaETqHFhIJ/IZqh1PDHwBYgmq6J/M1IlSxhaoFRSyGd9aU90xxGW Tc80cYV1fdf7ifFQi9k3HszZrU9x/h48XuYySArbOeOnn14Y3C67m0eF9hZ2cZK5pOzC GtwY1v/69isgSVJFyref9lEnJ8m0I9suiE+SrAGHXplo8hLRNThRTqLbIBK54VnsM/0b innA== X-Gm-Message-State: AHQUAubv7/TlKEX1eafQ6COENZNHh57pVGj0DeUxiYKGA3PK8un6s6i4 DL3ed7sge14/AuYRUnecCsSGRzFWhLsVczKfmAuqTg== X-Received: by 2002:a24:7284:: with SMTP id x126mr1797759itc.96.1550826257929; Fri, 22 Feb 2019 01:04:17 -0800 (PST) MIME-Version: 1.0 References: <20190221162627.3476-1-brgl@bgdev.pl> In-Reply-To: From: Bartosz Golaszewski Date: Fri, 22 Feb 2019 10:04:07 +0100 Message-ID: Subject: Re: [PATCH] drivers: depend on HAS_IOMEM for devm_platform_ioremap_resource() To: Andy Shevchenko 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 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 wro= te: > > > > > > From: Bartosz Golaszewski > > > > > > We only build devm_ioremap_resource() if HAS_IOMEM is selected, so th= is > > > 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 > I followed the example of devm_ioremap_resource() which doesn't do this - it just expects never to be used by systems without IOMEM. Bart