From patchwork Wed Oct 5 14:38:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 613517 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 6C16CC433F5 for ; Wed, 5 Oct 2022 14:38:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229815AbiJEOiD (ORCPT ); Wed, 5 Oct 2022 10:38:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229980AbiJEOiB (ORCPT ); Wed, 5 Oct 2022 10:38:01 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D6984F182; Wed, 5 Oct 2022 07:38:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664980680; x=1696516680; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=2SPqUsjF5qBIF1pomEqZowlFagnMO4IU7LXTD0kTMtM=; b=HLGXsYxK+NvkObZb2TBHzQd9uyCFUFh075dM+Q4DZaZGq/0T0XsquJqK 8cEu7sbyOcZn8HtutUUO0353BaQo6qi8c69A184XQL5l/I3/mZQLUh0pd WNwgHE8bF0pc1dN68XhvdUFiZU80MDAuFUaB3xlii6h+H9T/mmtCZwJuW G8bktIooqp31ozFNzAadNgMjSfFb2qCNQXbZ25YofIVLOyRBepzAk+GHD 2+1ZoE1xbm+QlgaFZwaD97BtjUYqoZJJ0b7Uwx+lW3Pzu9uiZWVzlJraZ Ur5Y9dtA6rf35kQMJrQGWHtjUitYaKQ/NpPuUStgi9Liurkpprs+Emd03 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10491"; a="282889703" X-IronPort-AV: E=Sophos;i="5.95,161,1661842800"; d="scan'208";a="282889703" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2022 07:38:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10491"; a="869420640" X-IronPort-AV: E=Sophos;i="5.95,161,1661842800"; d="scan'208";a="869420640" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga006.fm.intel.com with ESMTP; 05 Oct 2022 07:37:57 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 585C0155; Wed, 5 Oct 2022 17:38:17 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org Cc: Qiang Zhao , Li Yang , Daniel Scally , Heikki Krogerus , Sakari Ailus Subject: [PATCH v1 1/2] device property: Introduce fwnode_device_is_compatible() helper Date: Wed, 5 Oct 2022 17:38:11 +0300 Message-Id: <20221005143812.33503-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 The fwnode_device_is_compatible() helper searches for the given string in the "compatible" string array property and, if found, returns true. Signed-off-by: Andy Shevchenko --- include/linux/property.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/property.h b/include/linux/property.h index 1c26d263d5e4..4948a890b153 100644 --- a/include/linux/property.h +++ b/include/linux/property.h @@ -56,6 +56,11 @@ int device_property_match_string(struct device *dev, const char *propname, const char *string); bool fwnode_device_is_available(const struct fwnode_handle *fwnode); +bool fwnode_device_is_compatible(const struct fwnode_handle *fwnode, const char *compat) +{ + return fwnode_property_match_string(fwnode, "compatible", compat) >= 0; +} + bool fwnode_property_present(const struct fwnode_handle *fwnode, const char *propname); int fwnode_property_read_u8_array(const struct fwnode_handle *fwnode, From patchwork Wed Oct 5 14:38:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 612552 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 01D3DC433F5 for ; Wed, 5 Oct 2022 14:38:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230088AbiJEOiL (ORCPT ); Wed, 5 Oct 2022 10:38:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229980AbiJEOiH (ORCPT ); Wed, 5 Oct 2022 10:38:07 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 293887CAA4; Wed, 5 Oct 2022 07:38:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664980685; x=1696516685; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uI6x+OuIX8Zsde+No42SImigImxqe3gZvNiHUYWU+j8=; b=aDpn+9XMHsE0e2+ffSeqpDI8Hx3l944EC+sk718neEhyYHBoJzmScMwP Zw0iF3Y40EAX89qBN+2SAXnb+1mDRMNTid2Z+TppHDuKztHUBNyI8imOT 1yDBQvPOkGJwr709GbgsImivwuGLXXYjOPhVMRp3HUsyrTIM4SNHo9rZM 3q4NGnETFiRLeiZ1zT1UbPx7JcAPBoAN29eiv+VGx+tkLXzlBzfX9ZqnO 0nWWBRen7iK58BapVOA0V0hCVRqZiSZZzkjgJVAmF6BX+DM6ay2E2aCuS qotsAV8D6n+BTG7IZ5zrqJcv/TWrwDyIzDOXOyTPQnd2EOiVwzgn8Qbn+ g==; X-IronPort-AV: E=McAfee;i="6500,9779,10491"; a="304744012" X-IronPort-AV: E=Sophos;i="5.95,161,1661842800"; d="scan'208";a="304744012" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2022 07:38:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10491"; a="619481343" X-IronPort-AV: E=Sophos;i="5.95,161,1661842800"; d="scan'208";a="619481343" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 05 Oct 2022 07:38:01 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 6221A155; Wed, 5 Oct 2022 17:38:21 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org Cc: Qiang Zhao , Li Yang , Daniel Scally , Heikki Krogerus , Sakari Ailus Subject: [PATCH v1 2/2] soc: fsl: qe: Switch to use fwnode instead of of_node Date: Wed, 5 Oct 2022 17:38:12 +0300 Message-Id: <20221005143812.33503-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221005143812.33503-1-andriy.shevchenko@linux.intel.com> References: <20221005143812.33503-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The OF node in the GPIO library is deprecated and soon will be removed. GPIO library now accepts fwnode as a firmware node, so switch the driver to use it. Signed-off-by: Andy Shevchenko --- drivers/soc/fsl/qe/gpio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/soc/fsl/qe/gpio.c b/drivers/soc/fsl/qe/gpio.c index 99f7de43c3c6..9abb45ab138b 100644 --- a/drivers/soc/fsl/qe/gpio.c +++ b/drivers/soc/fsl/qe/gpio.c @@ -19,6 +19,8 @@ #include #include #include +#include + #include struct qe_gpio_chip { @@ -179,7 +181,7 @@ struct qe_pin *qe_pin_request(struct device_node *np, int index) goto err0; } - if (!of_device_is_compatible(gc->of_node, "fsl,mpc8323-qe-pario-bank")) { + if (!fwnode_device_is_compatible(gc->fwnode, "fsl,mpc8323-qe-pario-bank")) { pr_debug("%s: tried to get a non-qe pin\n", __func__); err = -EINVAL; goto err0;