Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1855183/?format=api
{ "id": 1855183, "url": "http://patchwork.ozlabs.org/api/patches/1855183/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20231025184259.250588-3-andriy.shevchenko@linux.intel.com/", "project": { "id": 42, "url": "http://patchwork.ozlabs.org/api/projects/42/?format=api", "name": "Linux GPIO development", "link_name": "linux-gpio", "list_id": "linux-gpio.vger.kernel.org", "list_email": "linux-gpio@vger.kernel.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20231025184259.250588-3-andriy.shevchenko@linux.intel.com>", "list_archive_url": null, "date": "2023-10-25T18:42:58", "name": "[v1,2/3] gpio: mmio: Make use of device properties", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "aacf5132074607a2d26cc5b5767486dc085fd3d6", "submitter": { "id": 8583, "url": "http://patchwork.ozlabs.org/api/people/8583/?format=api", "name": "Andy Shevchenko", "email": "andriy.shevchenko@linux.intel.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20231025184259.250588-3-andriy.shevchenko@linux.intel.com/mbox/", "series": [ { "id": 379349, "url": "http://patchwork.ozlabs.org/api/series/379349/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/list/?series=379349", "date": "2023-10-25T18:42:58", "name": "gpio: mmio: Make driver agnostic", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/379349/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1855183/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1855183/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linux-gpio-owner@vger.kernel.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256\n header.s=Intel header.b=Fq/B05hj;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2620:137:e000::1:20; helo=out1.vger.email;\n envelope-from=linux-gpio-owner@vger.kernel.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20])\n\tby legolas.ozlabs.org (Postfix) with ESMTP id 4SFyVW2lqmz23jp\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Oct 2023 05:43:15 +1100 (AEDT)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n id S229548AbjJYSnN (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n Wed, 25 Oct 2023 14:43:13 -0400", "from lindbergh.monkeyblade.net ([23.128.96.19]:48844 \"EHLO\n lindbergh.monkeyblade.net\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n with ESMTP id S229738AbjJYSnM (ORCPT\n <rfc822;linux-gpio@vger.kernel.org>); Wed, 25 Oct 2023 14:43:12 -0400", "from mgamail.intel.com (mgamail.intel.com [134.134.136.24])\n by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56946111;\n Wed, 25 Oct 2023 11:43:09 -0700 (PDT)", "from orsmga005.jf.intel.com ([10.7.209.41])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 25 Oct 2023 11:43:06 -0700", "from black.fi.intel.com ([10.237.72.28])\n by orsmga005.jf.intel.com with ESMTP; 25 Oct 2023 11:43:03 -0700", "by black.fi.intel.com (Postfix, from userid 1003)\n id E0D64430; Wed, 25 Oct 2023 21:43:01 +0300 (EEST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1698259389; x=1729795389;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=dpLiufvLW4ReyqiDHIArSLkX2JA+hA4CEIqKp4YRTIA=;\n b=Fq/B05hjLOj7NVxInMmTm3MMZNDfOue2B2WXBujoPldP6kxsC3MLuRbW\n lrBOJDpien2tSkFgptlLCtg64kaixV/P7gK4zP3yZ+JBjaGRipkRogCDY\n 2fi7oaEAh5YqqyBZesK/o9Li/ojC4QNoe+YPfBnv1GQdu303IIxjXN7bG\n Xp9ehJDQIS7uCKEIBLcH5jA75vEF951p3GlKcSHOvv6pd68PLQS5FZHrD\n REqzD9A+6WXA1EpB7uSV2p1C1fT2wFBtw1mkpEhWS5gtcls0AnU3DpzgN\n pd7IWKNU3dhB+X4z7P6gU27tvHTLfiIMxXTDKqY5mXy/T3jaU1PGB+UsX\n w==;", "X-IronPort-AV": [ "E=McAfee;i=\"6600,9927,10874\"; a=\"390233013\"", "E=Sophos;i=\"6.03,250,1694761200\";\n d=\"scan'208\";a=\"390233013\"", "E=McAfee;i=\"6600,9927,10874\"; a=\"932458248\"", "E=Sophos;i=\"6.03,250,1694761200\";\n d=\"scan'208\";a=\"932458248\"" ], "X-ExtLoop1": "1", "From": "Andy Shevchenko <andriy.shevchenko@linux.intel.com>", "To": "Andy Shevchenko <andriy.shevchenko@linux.intel.com>,\n Greg Kroah-Hartman <gregkh@linuxfoundation.org>,\n linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,\n linux-acpi@vger.kernel.org", "Cc": "Linus Walleij <linus.walleij@linaro.org>,\n Bartosz Golaszewski <brgl@bgdev.pl>,\n Andy Shevchenko <andy@kernel.org>,\n Daniel Scally <djrscally@gmail.com>,\n Heikki Krogerus <heikki.krogerus@linux.intel.com>,\n Sakari Ailus <sakari.ailus@linux.intel.com>,\n \"Rafael J. Wysocki\" <rafael@kernel.org>,\n Rob Herring <robh+dt@kernel.org>", "Subject": "[PATCH v1 2/3] gpio: mmio: Make use of device properties", "Date": "Wed, 25 Oct 2023 21:42:58 +0300", "Message-Id": "<20231025184259.250588-3-andriy.shevchenko@linux.intel.com>", "X-Mailer": "git-send-email 2.40.0.1.gaa8946217a0b", "In-Reply-To": "<20231025184259.250588-1-andriy.shevchenko@linux.intel.com>", "References": "<20231025184259.250588-1-andriy.shevchenko@linux.intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Spam-Status": "No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE\n autolearn=ham autolearn_force=no version=3.4.6", "X-Spam-Checker-Version": "SpamAssassin 3.4.6 (2021-04-09) on\n lindbergh.monkeyblade.net", "Precedence": "bulk", "List-ID": "<linux-gpio.vger.kernel.org>", "X-Mailing-List": "linux-gpio@vger.kernel.org" }, "content": "Convert the module to be property provider agnostic and allow\nit to be used on non-OF platforms.\n\nSigned-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>\n---\n drivers/gpio/gpio-mmio.c | 25 +++++++------------------\n 1 file changed, 7 insertions(+), 18 deletions(-)", "diff": "diff --git a/drivers/gpio/gpio-mmio.c b/drivers/gpio/gpio-mmio.c\nindex 3ff0ea1e351c..66308b165a0d 100644\n--- a/drivers/gpio/gpio-mmio.c\n+++ b/drivers/gpio/gpio-mmio.c\n@@ -58,7 +58,6 @@ o ` ~~~~\\___/~~~~ ` controller in FPGA is ,.`\n #include <linux/platform_device.h>\n #include <linux/property.h>\n #include <linux/mod_devicetable.h>\n-#include <linux/of.h>\n \n #include \"gpiolib.h\"\n \n@@ -688,7 +687,6 @@ static void __iomem *bgpio_map(struct platform_device *pdev,\n \treturn devm_ioremap_resource(&pdev->dev, r);\n }\n \n-#ifdef CONFIG_OF\n static const struct of_device_id bgpio_of_match[] = {\n \t{ .compatible = \"brcm,bcm6345-gpio\" },\n \t{ .compatible = \"wd,mbl-gpio\" },\n@@ -697,36 +695,27 @@ static const struct of_device_id bgpio_of_match[] = {\n };\n MODULE_DEVICE_TABLE(of, bgpio_of_match);\n \n-static struct bgpio_pdata *bgpio_parse_dt(struct platform_device *pdev,\n-\t\t\t\t\t unsigned long *flags)\n+static struct bgpio_pdata *bgpio_parse_fw(struct device *dev, unsigned long *flags)\n {\n \tstruct bgpio_pdata *pdata;\n \n-\tif (!pdev->dev.of_node)\n+\tif (!dev_fwnode(dev))\n \t\treturn NULL;\n \n-\tpdata = devm_kzalloc(&pdev->dev, sizeof(struct bgpio_pdata),\n-\t\t\t GFP_KERNEL);\n+\tpdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);\n \tif (!pdata)\n \t\treturn ERR_PTR(-ENOMEM);\n \n \tpdata->base = -1;\n \n-\tif (of_device_is_big_endian(pdev->dev.of_node))\n+\tif (device_is_big_endian(dev))\n \t\t*flags |= BGPIOF_BIG_ENDIAN_BYTE_ORDER;\n \n-\tif (of_property_read_bool(pdev->dev.of_node, \"no-output\"))\n+\tif (device_property_read_bool(dev, \"no-output\"))\n \t\t*flags |= BGPIOF_NO_OUTPUT;\n \n \treturn pdata;\n }\n-#else\n-static struct bgpio_pdata *bgpio_parse_dt(struct platform_device *pdev,\n-\t\t\t\t\t unsigned long *flags)\n-{\n-\treturn NULL;\n-}\n-#endif /* CONFIG_OF */\n \n static int bgpio_pdev_probe(struct platform_device *pdev)\n {\n@@ -743,7 +732,7 @@ static int bgpio_pdev_probe(struct platform_device *pdev)\n \tstruct gpio_chip *gc;\n \tstruct bgpio_pdata *pdata;\n \n-\tpdata = bgpio_parse_dt(pdev, &flags);\n+\tpdata = bgpio_parse_fw(dev, &flags);\n \tif (IS_ERR(pdata))\n \t\treturn PTR_ERR(pdata);\n \n@@ -814,7 +803,7 @@ MODULE_DEVICE_TABLE(platform, bgpio_id_table);\n static struct platform_driver bgpio_driver = {\n \t.driver = {\n \t\t.name = \"basic-mmio-gpio\",\n-\t\t.of_match_table = of_match_ptr(bgpio_of_match),\n+\t\t.of_match_table = bgpio_of_match,\n \t},\n \t.id_table = bgpio_id_table,\n \t.probe = bgpio_pdev_probe,\n", "prefixes": [ "v1", "2/3" ] }