From patchwork Thu Sep 22 13:54:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 608273 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD8AEC54EE9 for ; Thu, 22 Sep 2022 13:54:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230209AbiIVNx7 (ORCPT ); Thu, 22 Sep 2022 09:53:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231472AbiIVNx7 (ORCPT ); Thu, 22 Sep 2022 09:53:59 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99766CE1B; Thu, 22 Sep 2022 06:53:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663854838; x=1695390838; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=TGRlhzszJtskHi6su65+eCvkVyzU5lO4sziinuRy1JI=; b=V7dCkUaStBQKhycSOnd2teEgDfW498ymR6hXLVEhgUPWj3XbRPsIbC0q 4f+Lg5o1XX7KHhbYmPLRT1/G5aRdIOD3+3ydFsCgN6GGRJmQrHHJCcv9k f0p8huwOmab8eJpiM+D+9LS5ijgPrgSL9VJRN7OXigXWcU4c2QqpptEag y0sQ20ubGlLc+l9oLbpo4X+8alMJMSignCaAw5Bim8Xyw3WlXItEiJ3fv kMCQMNIZ62URCQXJuPKrQflU2iK5z1MesPN4Z54ZUJgdwwwwRFZ10aB5M uOPUM9rpXRRAj4mh3bzxGVSjdl3GCfL6Z03/pa+ZBvm9Ph70pSVa7Gnak A==; X-IronPort-AV: E=McAfee;i="6500,9779,10478"; a="301710563" X-IronPort-AV: E=Sophos;i="5.93,335,1654585200"; d="scan'208";a="301710563" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2022 06:53:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,335,1654585200"; d="scan'208";a="723669359" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 22 Sep 2022 06:53:55 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 5C2D3238; Thu, 22 Sep 2022 16:54:13 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , kernel test robot Subject: [PATCH v1 1/1] device property: Add const qualifier to device_get_match_data() parameter Date: Thu, 22 Sep 2022 16:54:10 +0300 Message-Id: <20220922135410.49694-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Add const qualifier to the device_get_match_data() parameter. Some of the future users may utilize this function without forcing the type. All the same, dev_fwnode() may be used with a const qualifier. Reported-by: kernel test robot Signed-off-by: Andy Shevchenko Acked-by: Heikki Krogerus --- drivers/base/property.c | 4 ++-- include/linux/property.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/base/property.c b/drivers/base/property.c index ed6f449f8e5c..4d6278a84868 100644 --- a/drivers/base/property.c +++ b/drivers/base/property.c @@ -17,7 +17,7 @@ #include #include -struct fwnode_handle *dev_fwnode(struct device *dev) +struct fwnode_handle *dev_fwnode(const struct device *dev) { return IS_ENABLED(CONFIG_OF) && dev->of_node ? of_fwnode_handle(dev->of_node) : dev->fwnode; @@ -1200,7 +1200,7 @@ int fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode, } EXPORT_SYMBOL(fwnode_graph_parse_endpoint); -const void *device_get_match_data(struct device *dev) +const void *device_get_match_data(const struct device *dev) { return fwnode_call_ptr_op(dev_fwnode(dev), device_get_match_data, dev); } diff --git a/include/linux/property.h b/include/linux/property.h index a5b429d623f6..117cc200c656 100644 --- a/include/linux/property.h +++ b/include/linux/property.h @@ -32,7 +32,7 @@ enum dev_dma_attr { DEV_DMA_COHERENT, }; -struct fwnode_handle *dev_fwnode(struct device *dev); +struct fwnode_handle *dev_fwnode(const struct device *dev); bool device_property_present(struct device *dev, const char *propname); int device_property_read_u8_array(struct device *dev, const char *propname, @@ -387,7 +387,7 @@ bool device_dma_supported(struct device *dev); enum dev_dma_attr device_get_dma_attr(struct device *dev); -const void *device_get_match_data(struct device *dev); +const void *device_get_match_data(const struct device *dev); int device_get_phy_mode(struct device *dev); int fwnode_get_phy_mode(struct fwnode_handle *fwnode);