From mboxrd@z Thu Jan 1 00:00:00 1970 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=unavailable 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 33095C2D0DB for ; Fri, 24 Jan 2020 11:26:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 09016206D4 for ; Fri, 24 Jan 2020 11:26:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579865200; bh=WLedvEAo3d4TFywakfUeBYv6rMarcSdRIwMo3BJ8wT0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=xa8lB3zoMXemLx5o7yw58ZbZRJbjxYQIupni3uZhQCYLBoAYuWHQkGhwbKLGSd47x Zo+2LurP9PsroHwSszYF3ztCncu3X5YnyX9k5tzpU3LtfiyCgEsHDe4X8y3H5f0CSz LZ457xE5OpfxHnw3QHAZT0N1fG0W7qsn806lCUQc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391574AbgAXL0j (ORCPT ); Fri, 24 Jan 2020 06:26:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:41472 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391565AbgAXL0f (ORCPT ); Fri, 24 Jan 2020 06:26:35 -0500 Received: from localhost (ip-213-127-102-57.ip.prioritytelecom.net [213.127.102.57]) (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 ED10522522; Fri, 24 Jan 2020 11:26:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579865194; bh=WLedvEAo3d4TFywakfUeBYv6rMarcSdRIwMo3BJ8wT0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vn8d9+kdsz6jo2tFNclwBCO6YsexiiBXfEURjk9eFOkdduuc2UxQXwz0qrU6Ud7Ut tBCvCAtS3+kSIBGmfdEEDhRRMTDruBn3gCphhGR+iVomgSnKIcCVvKy7mUWFZ3vfyn ooFFSYe1CVmFuQ6RK3RmtWfIeJ/6GmwdW40zfGkQ= 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.19 466/639] devres: allow const resource arguments Date: Fri, 24 Jan 2020 10:30:36 +0100 Message-Id: <20200124093145.663016156@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124093047.008739095@linuxfoundation.org> References: <20200124093047.008739095@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 e9d1c768f972a..c74ce473589ae 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -701,7 +701,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); void __iomem *devm_of_iomap(struct device *dev, struct device_node *node, int index, diff --git a/lib/devres.c b/lib/devres.c index faccf1a037d05..aa0f5308ac6be 100644 --- a/lib/devres.c +++ b/lib/devres.c @@ -131,7 +131,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; -- 2.20.1