From patchwork Fri Jan 24 09:31:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 233157 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B905C2D0DB for ; Fri, 24 Jan 2020 10:01:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E4B06214DB for ; Fri, 24 Jan 2020 10:01:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579860070; bh=xVKU+QbTX2JZ8X7nd+tVJGGZPS8tPF+t+IHeV3VA9hI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=jqXE1r4P3PRYj0+CIMnbpFUDutHcvkcWsfLPkJxCL+lSPAbx8X3EJ2kw4JGVXaYXO UEAF46rwyXWwhVxo1NPDa8ZZhxig7l+Q+9M3KVcmkIWj2m+FQ2ZRJacxNTSE64Vt2+ 6iXM11gJDPrlUQL+mqmia5ga4HaTV8AJ+SwWjR/o= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730328AbgAXKBJ (ORCPT ); Fri, 24 Jan 2020 05:01:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:36530 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727215AbgAXKBJ (ORCPT ); Fri, 24 Jan 2020 05:01:09 -0500 Received: from localhost (unknown [145.15.244.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F3D5220709; Fri, 24 Jan 2020 10:01:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579860068; bh=xVKU+QbTX2JZ8X7nd+tVJGGZPS8tPF+t+IHeV3VA9hI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JOfGsgycnQDzcRI6zMAx8/b7Hvc+XUTepA50NSTS8aIsWHx5z6qzDPg094Rmt9wgW O2zY7CSUxpoKrSJX3Urj+Wmb7EOyzXpiaj0DCyYF/sT45cpWUthg1bd/3G2FackUMr 6ehluuZw0k5/wTMeO8nyyKr1qQ1SyRy1JiuSdSXA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Linus Walleij , Sasha Levin , Enrico Weigelt Subject: [PATCH 4.14 251/343] devres: allow const resource arguments Date: Fri, 24 Jan 2020 10:31:09 +0100 Message-Id: <20200124092953.083336671@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124092919.490687572@linuxfoundation.org> References: <20200124092919.490687572@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit 9dea44c91469512d346e638694c22c30a5273992 ] devm_ioremap_resource() does not currently take 'const' arguments, which results in a warning from the first driver trying to do it anyway: drivers/gpio/gpio-amd-fch.c: In function 'amd_fch_gpio_probe': drivers/gpio/gpio-amd-fch.c:171:49: error: passing argument 2 of 'devm_ioremap_resource' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] priv->base = devm_ioremap_resource(&pdev->dev, &amd_fch_gpio_iores); ^~~~~~~~~~~~~~~~~~~ Change the prototype to allow it, as there is no real reason not to. Fixes: 9bb2e0452508 ("gpio: amd: Make resource struct const") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20190628150049.1108048-1-arnd@arndb.de Acked-by: Greg Kroah-Hartman Reviwed-By: Enrico Weigelt Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- include/linux/device.h | 3 ++- lib/devres.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/device.h b/include/linux/device.h index 66fe271c2544d..0b2e67014a833 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -682,7 +682,8 @@ extern unsigned long devm_get_free_pages(struct device *dev, gfp_t gfp_mask, unsigned int order); extern void devm_free_pages(struct device *dev, unsigned long addr); -void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res); +void __iomem *devm_ioremap_resource(struct device *dev, + const struct resource *res); /* allows to add/remove a custom action to devres stack */ int devm_add_action(struct device *dev, void (*action)(void *), void *data); diff --git a/lib/devres.c b/lib/devres.c index 5f2aedd58bc50..40a8b12a8b6b9 100644 --- a/lib/devres.c +++ b/lib/devres.c @@ -132,7 +132,8 @@ EXPORT_SYMBOL(devm_iounmap); * if (IS_ERR(base)) * return PTR_ERR(base); */ -void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res) +void __iomem *devm_ioremap_resource(struct device *dev, + const struct resource *res) { resource_size_t size; const char *name;