From patchwork Tue Oct 10 15:17:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13415710 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 497A030FB4 for ; Tue, 10 Oct 2023 15:18:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="k6YKOrzT" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696951129; x=1728487129; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=w1u+oz+TxHGbO6VqcwI4Fu7bojupIN05OR98eU3NVvk=; b=k6YKOrzTcWraLLYtcZGaCknOPXiLRdTgnEN3Q+PiVGgJnLSnl4ra4Keu k2aU3hWbjAsQl8xvd2lAkuiOJXm2xycJwwn+ScK76Gh61g1j9rqONSoyD 8m42ZYcErBooFAora60pJE6C+/Gac134ueCZYCw++Uw9xnYp8wHwlTCtX rvTcOmEOcYU+4L7l0lR35aNpgDQ7h2zWnr623cawIlAGJs1CUz5MEfPjS Q4KunvwkPsqdYBG51ta0c/kErq/UC5JQiGjH9GH9yEL4+S5lE2x/M4EbK zUSMb0v4OwtFRlY6fM1gO8htLNsztS20wQP4K41lR9TPpzZ6HmciRsQ4G Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="415439397" X-IronPort-AV: E=Sophos;i="6.03,213,1694761200"; d="scan'208";a="415439397" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2023 08:17:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="1084830070" X-IronPort-AV: E=Sophos;i="6.03,213,1694761200"; d="scan'208";a="1084830070" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 10 Oct 2023 08:17:10 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 33E8D93; Tue, 10 Oct 2023 18:17:10 +0300 (EEST) From: Andy Shevchenko To: Bartosz Golaszewski , Andy Shevchenko , Dipen Patel , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, timestamp@lists.linux.dev, linux-tegra@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Thierry Reding , Jonathan Hunter Subject: [PATCH v1 1/4] gpiolib: provide gpio_device_find_by_fwnode() Date: Tue, 10 Oct 2023 18:17:06 +0300 Message-Id: <20231010151709.4104747-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20231010151709.4104747-1-andriy.shevchenko@linux.intel.com> References: <20231010151709.4104747-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: timestamp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 One of the ways of looking up GPIO devices is using their fwnode. Provide a helper for that to avoid every user implementing their own matching function. Signed-off-by: Andy Shevchenko Acked-by: Linus Walleij --- drivers/gpio/gpiolib.c | 20 ++++++++++++++++++++ include/linux/gpio/driver.h | 1 + 2 files changed, 21 insertions(+) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 7b4d12b714a3..31c06a32cb8a 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1142,6 +1142,26 @@ struct gpio_device *gpio_device_find_by_label(const char *label) } EXPORT_SYMBOL_GPL(gpio_device_find_by_label); +static int gpio_chip_match_by_fwnode(struct gpio_chip *gc, void *fwnode) +{ + return device_match_fwnode(&gc->gpiodev->dev, fwnode); +} + +/** + * gpio_device_find_by_fwnode() - wrapper around gpio_device_find() finding + * the GPIO device by its fwnode + * @fwnode: Firmware node to lookup + * + * Returns: + * Reference to the GPIO device or NULL. Reference must be released with + * gpio_device_put(). + */ +struct gpio_device *gpio_device_find_by_fwnode(const struct fwnode_handle *fwnode) +{ + return gpio_device_find((void *)fwnode, gpio_chip_match_by_fwnode); +} +EXPORT_SYMBOL_GPL(gpio_device_find_by_fwnode); + /** * gpio_device_get() - Increase the reference count of this GPIO device * @gdev: GPIO device to increase the refcount for diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index f8ad7f40100c..ae4162d3f1d3 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -611,6 +611,7 @@ struct gpio_chip *gpiochip_find(void *data, struct gpio_device *gpio_device_find(void *data, int (*match)(struct gpio_chip *gc, void *data)); struct gpio_device *gpio_device_find_by_label(const char *label); +struct gpio_device *gpio_device_find_by_fwnode(const struct fwnode_handle *fwnode); struct gpio_device *gpio_device_get(struct gpio_device *gdev); void gpio_device_put(struct gpio_device *gdev); From patchwork Tue Oct 10 15:17:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13415708 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96D3221364 for ; Tue, 10 Oct 2023 15:17:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="lFbfgTo0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696951038; x=1728487038; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=l6DdkRg1hXfc8CWke14GcuC2dyWewQd6DP8vUh4t5nE=; b=lFbfgTo0hFCIyxs1p3CmfbSgecndmoSGyO366oxOEoRNw2WzRIR9w5cp uiomrU6SaSCpc8v7LdGxn4hTZU9XAz9O/jNk4Hp8gN5olBbFC//TtJaFy cEPWKbGnZXH7yo/hBQTXANaCKaznTnd8Ye8Gmfoh4IQdmAK6YWSypt7tQ sR3XOAQbmbyVOXH2xk+5UXY+1y3rvrn4Pean9inHO5DidAA1ySrp/eFmf pQE8BbLnXeYR+reb1lGAvu+WuanKkMq0RVqXj/WhSkyK+uE/szdyvZhQx wpYHx4os79aRYedFzujpMuZESZQ9ilcd/0asDX+kvYz0/6fdhBYGXXOL2 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="363771596" X-IronPort-AV: E=Sophos;i="6.03,213,1694761200"; d="scan'208";a="363771596" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2023 08:17:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="823812777" X-IronPort-AV: E=Sophos;i="6.03,213,1694761200"; d="scan'208";a="823812777" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 10 Oct 2023 08:17:11 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 3F9666CB; Tue, 10 Oct 2023 18:17:10 +0300 (EEST) From: Andy Shevchenko To: Bartosz Golaszewski , Andy Shevchenko , Dipen Patel , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, timestamp@lists.linux.dev, linux-tegra@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Thierry Reding , Jonathan Hunter Subject: [PATCH v1 2/4] hte: tegra194: don't access struct gpio_chip Date: Tue, 10 Oct 2023 18:17:07 +0300 Message-Id: <20231010151709.4104747-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20231010151709.4104747-1-andriy.shevchenko@linux.intel.com> References: <20231010151709.4104747-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: timestamp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Bartosz Golaszewski Using struct gpio_chip is not safe as it will disappear if the underlying driver is unbound for any reason. Switch to using reference counted struct gpio_device and its dedicated accessors. Signed-off-by: Bartosz Golaszewski Tested-by: Dipen Patel Reviewed-by: Linus Walleij [andy: used gpio_device_find_by_fwnode()] Signed-off-by: Andy Shevchenko Tested-by: Dipen Patel --- drivers/hte/hte-tegra194.c | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/drivers/hte/hte-tegra194.c b/drivers/hte/hte-tegra194.c index 9fd3c00ff695..339ff5921ec8 100644 --- a/drivers/hte/hte-tegra194.c +++ b/drivers/hte/hte-tegra194.c @@ -132,7 +132,7 @@ struct tegra_hte_soc { const struct tegra_hte_data *prov_data; struct tegra_hte_line_data *line_data; struct hte_chip *chip; - struct gpio_chip *c; + struct gpio_device *gdev; void __iomem *regs; }; @@ -421,7 +421,7 @@ static int tegra_hte_line_xlate(struct hte_chip *gc, * HTE/GTE namespace. */ if (gs->prov_data->type == HTE_TEGRA_TYPE_GPIO && !args) { - line_id = desc->attr.line_id - gs->c->base; + line_id = desc->attr.line_id - gpio_device_get_base(gs->gdev); map = gs->prov_data->map; map_sz = gs->prov_data->map_sz; } else if (gs->prov_data->type == HTE_TEGRA_TYPE_GPIO && args) { @@ -643,12 +643,15 @@ static irqreturn_t tegra_hte_isr(int irq, void *dev_id) static bool tegra_hte_match_from_linedata(const struct hte_chip *chip, const struct hte_ts_desc *hdesc) { + struct gpio_device *gdev __free(gpio_device_put) = NULL; struct tegra_hte_soc *hte_dev = chip->data; if (!hte_dev || (hte_dev->prov_data->type != HTE_TEGRA_TYPE_GPIO)) return false; - return hte_dev->c == gpiod_to_chip(hdesc->attr.line_data); + gdev = gpiod_to_device(hdesc->attr.line_data); + + return hte_dev->gdev == gdev; } static const struct of_device_id tegra_hte_of_match[] = { @@ -676,14 +679,11 @@ static void tegra_gte_disable(void *data) tegra_hte_writel(gs, HTE_TECTRL, 0); } -static int tegra_get_gpiochip_from_name(struct gpio_chip *chip, void *data) +static void tegra_hte_put_gpio_device(void *data) { - return !strcmp(chip->label, data); -} + struct gpio_device *gdev = data; -static int tegra_gpiochip_match(struct gpio_chip *chip, void *data) -{ - return chip->fwnode == of_node_to_fwnode(data); + gpio_device_put(gdev); } static int tegra_hte_probe(struct platform_device *pdev) @@ -763,8 +763,8 @@ static int tegra_hte_probe(struct platform_device *pdev) if (of_device_is_compatible(dev->of_node, "nvidia,tegra194-gte-aon")) { - hte_dev->c = gpiochip_find("tegra194-gpio-aon", - tegra_get_gpiochip_from_name); + hte_dev->gdev = + gpio_device_find_by_label("tegra194-gpio-aon"); } else { gpio_ctrl = of_parse_phandle(dev->of_node, "nvidia,gpio-controller", @@ -775,14 +775,19 @@ static int tegra_hte_probe(struct platform_device *pdev) return -ENODEV; } - hte_dev->c = gpiochip_find(gpio_ctrl, - tegra_gpiochip_match); + hte_dev->gdev = + gpio_device_find_by_fwnode(of_fnode_handle(gpio_ctrl)); of_node_put(gpio_ctrl); } - if (!hte_dev->c) + if (!hte_dev->gdev) return dev_err_probe(dev, -EPROBE_DEFER, "wait for gpio controller\n"); + + ret = devm_add_action_or_reset(dev, tegra_hte_put_gpio_device, + hte_dev->gdev); + if (ret) + return ret; } hte_dev->chip = gc; From patchwork Tue Oct 10 15:17:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13415707 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F227321364 for ; Tue, 10 Oct 2023 15:17:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Le9JsAMX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696951035; x=1728487035; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cfi2ScUuQ38Rjpas5/iU2szLV7W2WROp/dyzeK87y4E=; b=Le9JsAMXzu6hiualXFlj7fozE7j2WzEbyBFEwaRjRlaIvwiGRk1a3zCL BkObenoQABiMwqsbOTrjpSYgLdUBj6IIgIeRnWcgX3fEoU+ynReGQTo2e 6599131reoVMzgww2yC0S/BDlXxz8Y/O4ENuTKW6CGV6HqYgi4XYxdvqS OJMlSy3ovHiCxxq8wBRs+DBWfRwrSr9LhCm0PasoHv2p8nk4oz51FN3Ca Uc+g9vJgmBtRWM4ipQ+SAM7jKYmdDhI/7r+vYCq2ie1vRVAhp918FVQ7M NYp5nZqbwkha9MPnWqMAFWxMaGvzo0gNcW4y8t1OgdW4XtPDms/aDzY2v w==; X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="363771589" X-IronPort-AV: E=Sophos;i="6.03,213,1694761200"; d="scan'208";a="363771589" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2023 08:17:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="823812776" X-IronPort-AV: E=Sophos;i="6.03,213,1694761200"; d="scan'208";a="823812776" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 10 Oct 2023 08:17:11 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 484EE6DA; Tue, 10 Oct 2023 18:17:10 +0300 (EEST) From: Andy Shevchenko To: Bartosz Golaszewski , Andy Shevchenko , Dipen Patel , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, timestamp@lists.linux.dev, linux-tegra@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Thierry Reding , Jonathan Hunter Subject: [PATCH v1 3/4] hte: tegra194: Remove redundant dev_err() Date: Tue, 10 Oct 2023 18:17:08 +0300 Message-Id: <20231010151709.4104747-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20231010151709.4104747-1-andriy.shevchenko@linux.intel.com> References: <20231010151709.4104747-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: timestamp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 There is no need to call the dev_err() function directly to print a custom message when handling an error from platform_get_irq() function as it is going to display an appropriate error message in case of a failure. Signed-off-by: Andy Shevchenko Reviewed-by: Dipen Patel --- drivers/hte/hte-tegra194.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/hte/hte-tegra194.c b/drivers/hte/hte-tegra194.c index 339ff5921ec8..30ef1750a9fa 100644 --- a/drivers/hte/hte-tegra194.c +++ b/drivers/hte/hte-tegra194.c @@ -731,10 +731,8 @@ static int tegra_hte_probe(struct platform_device *pdev) return -ENOMEM; ret = platform_get_irq(pdev, 0); - if (ret < 0) { - dev_err_probe(dev, ret, "failed to get irq\n"); + if (ret < 0) return ret; - } hte_dev->hte_irq = ret; ret = devm_request_irq(dev, hte_dev->hte_irq, tegra_hte_isr, 0, dev_name(dev), hte_dev); From patchwork Tue Oct 10 15:17:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13415709 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 640564736B for ; Tue, 10 Oct 2023 15:17:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="fruV9EC6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696951039; x=1728487039; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=b+eQ/uwdz+URzIJFW2ABqaZbfeJbxTuJSgGGfs7US3E=; b=fruV9EC6mCD5DvrnyTIe6bLhwf9+p0BB57jzvdjnJLiMaMOOiO7D7i4B OK45OsyA+1e0YcLFz1Nkt0zUr1+CPsra++Uk7ZRgOn+zg70oHjoYlU8H8 5hxkCkrrFJ0SbuVgNytgd3h9Vx0FDgOLbuVdolgAgrBKHzouU4iC1R2mG nIY1jtHsFQIpVqqN8DCwSpfFMlvAp5CquqKhsau9BovLtPonSQwc8BORJ zSG1uYkWs4YzJrf+9LISQ4qKKV8AtdQ5RVQJpm0OWmjwlrvq0QrwyWiPD mJWfij8Edw2jazUhPcd7nQTqK0nlmx4XdhN9hI3QAiujCS6dsl7q+gU6B w==; X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="363771582" X-IronPort-AV: E=Sophos;i="6.03,213,1694761200"; d="scan'208";a="363771582" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2023 08:17:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="823812775" X-IronPort-AV: E=Sophos;i="6.03,213,1694761200"; d="scan'208";a="823812775" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 10 Oct 2023 08:17:11 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 524C671B; Tue, 10 Oct 2023 18:17:10 +0300 (EEST) From: Andy Shevchenko To: Bartosz Golaszewski , Andy Shevchenko , Dipen Patel , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, timestamp@lists.linux.dev, linux-tegra@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Thierry Reding , Jonathan Hunter Subject: [PATCH v1 4/4] hte: tegra194: Switch to LATE_SIMPLE_DEV_PM_OPS() Date: Tue, 10 Oct 2023 18:17:09 +0300 Message-Id: <20231010151709.4104747-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20231010151709.4104747-1-andriy.shevchenko@linux.intel.com> References: <20231010151709.4104747-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: timestamp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 SET_LATE_SYSTEM_SLEEP_PM_OPS is deprecated, replace it with LATE_SYSTEM_SLEEP_PM_OPS() and use pm_sleep_ptr() for setting the driver's pm routines. We can now remove the __maybe_unused qualifier in the suspend and resume functions. Signed-off-by: Andy Shevchenko Tested-by: Dipen Patel --- drivers/hte/hte-tegra194.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/hte/hte-tegra194.c b/drivers/hte/hte-tegra194.c index 30ef1750a9fa..30fa7c0a555e 100644 --- a/drivers/hte/hte-tegra194.c +++ b/drivers/hte/hte-tegra194.c @@ -815,7 +815,7 @@ static int tegra_hte_probe(struct platform_device *pdev) return 0; } -static int __maybe_unused tegra_hte_resume_early(struct device *dev) +static int tegra_hte_resume_early(struct device *dev) { u32 i; struct tegra_hte_soc *gs = dev_get_drvdata(dev); @@ -836,7 +836,7 @@ static int __maybe_unused tegra_hte_resume_early(struct device *dev) return 0; } -static int __maybe_unused tegra_hte_suspend_late(struct device *dev) +static int tegra_hte_suspend_late(struct device *dev) { u32 i; struct tegra_hte_soc *gs = dev_get_drvdata(dev); @@ -856,15 +856,14 @@ static int __maybe_unused tegra_hte_suspend_late(struct device *dev) } static const struct dev_pm_ops tegra_hte_pm = { - SET_LATE_SYSTEM_SLEEP_PM_OPS(tegra_hte_suspend_late, - tegra_hte_resume_early) + LATE_SYSTEM_SLEEP_PM_OPS(tegra_hte_suspend_late, tegra_hte_resume_early) }; static struct platform_driver tegra_hte_driver = { .probe = tegra_hte_probe, .driver = { .name = "tegra_hte", - .pm = &tegra_hte_pm, + .pm = pm_slee_ptr(&tegra_hte_pm), .of_match_table = tegra_hte_of_match, }, };