From patchwork Tue Oct 18 08:49:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Svyatoslav Ryhel X-Patchwork-Id: 4029 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1850216wrs; Tue, 18 Oct 2022 02:05:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6E1FcIwMKsR+XbUTK7bfgJzUUe4etKM6iCrz4y5kkvwS+jJQxFbcuWGGCidWB6dkHmCNhU X-Received: by 2002:a17:907:72d2:b0:78d:4c16:a68d with SMTP id du18-20020a17090772d200b0078d4c16a68dmr1533474ejc.401.1666083924386; Tue, 18 Oct 2022 02:05:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666083924; cv=none; d=google.com; s=arc-20160816; b=g5ooU27YVxq6BNA2N1mRLlEnQoRPJgREpF1UbH+ePFQTdjQQt/YOZ3QPkbx833Obrw uw/n2zZfi/sjHZWW216rxVAJ0SU5cOIOmVczo+kBC6vVYsQeZVOgKlmTzQyTl7y052aq k5kBDOXxrBVHMdDXVFq3R3qZpIjvvASUxOo6LzvcXexJJTmNp4S6lLIA9IgU2/foiM4A p6khtqMcTRSyCJuZ+WiZT6O8CI6oPMsD3eAcxlDvwONtRwp1u96i+yf0JpCJ03qjpg0K /gWowy0DgXW6puBT69u43fNRyo9bFia6XVloQtDwzjBCEjNN4WliJ3EqRlVd+L/+9ouu HyIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7Ittdb6vpPq1cRywgTUHTYSBDHDcOaOE6DaEoaGh8YM=; b=jQrsESI1m5oWwOs0pCoQ4OCRGtzbuk3D/Li1uPDfLbATLn3PjiMVMWibxX5YU5mqzH HL3MvqhAzotXT9ZufnkDuRfYVlYOmLhNjpiorSteehsTV58V8Hqka+Ej/2aD4tmKXRKv J6XBkHkUvv+Nybqrv4fH12WKsTUSEZ7FCDSK8Yiuwak2MxM2PTa9XL/QYzTOZ4lSoJs+ Nz0SaFODfhlYThQGVoJugMGRaBeP7m+Eo2AMKvZ4HtNLKjgcKILuwnVTku1aiERLSpvp Vqe8maulQMCs7iMK0l/Vjp8bqsMJ8qqk6NlG+ZlZh0d3WzY28xS4kOZN5zkB6OJrXt++ M1Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=krCqaYYS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sd11-20020a1709076e0b00b007707f83375bsi11947811ejc.945.2022.10.18.02.04.58; Tue, 18 Oct 2022 02:05:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=krCqaYYS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231150AbiJRIuA (ORCPT + 99 others); Tue, 18 Oct 2022 04:50:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231148AbiJRIt5 (ORCPT ); Tue, 18 Oct 2022 04:49:57 -0400 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4D82DF81; Tue, 18 Oct 2022 01:49:28 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id m23so17025745lji.2; Tue, 18 Oct 2022 01:49:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7Ittdb6vpPq1cRywgTUHTYSBDHDcOaOE6DaEoaGh8YM=; b=krCqaYYSLmJYdJvQYwjptmDh1lS+zQ78QhKT3hTwbL799UkyWti9qu7P7B1G4pwhf1 IfHeyy+6RMdvVR3eoKxS01QsFdm33buS4EU2sO3+1VxSnAFjBrmtUMMMJvNb2X+ey84y FJ1ZXzP7McqJbwhp1RSSFPwOieRid9X5YGWdQ73OiMumXxth449mIyWy4wHo+K+tYcYL PThV/KTHciQHKK8f/pjDtG5T33ZXB9i9z3qcZOV0qLOrVMu8VPdKVb+hECO7Gijz/UIZ GNfHhEk/dGzoYYs1DEIkv83UrqPGGlzFJCdcf4D+LkVxDTru0xVmy9Qi/na2fh0oOdQm 6UxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7Ittdb6vpPq1cRywgTUHTYSBDHDcOaOE6DaEoaGh8YM=; b=2DTWYlyH9rdRN3rjn5bkajPDsgsXYBAbvAurZPoQh9va6i0TrthqYTWUQz0aVRhZPu Abhunh7UwMOUxswybwnjBne9zHeZxS0nAGK9lCXo3wZTuWywRFS2JXwQYcWR0fSElPy1 jIvwYQnzhGh3FLFGQMuDBIoq08ONm042rCymt8LizsaMywh7jBaySgjaw6/VIItvw58h OEEBInWnYbNNPlfifJHTwKPnu/58jbD3X6uMwl0bWNu0mqODrOTlKSzuerC96A8/+iSl hs/dy1a+bcYc77Q3mWpPijVEjU+tih04rn2Ajh05P5cpasokZDymuMVyOER+Eet9yU93 YHPg== X-Gm-Message-State: ACrzQf1QhUE9Z3lw7QWKhf6UVSmc++ap6qjGzB0DodncmPVoTdNv8foD wVucU3dm3DyANZZMSeaNtPU= X-Received: by 2002:a2e:3801:0:b0:26f:f8da:5da9 with SMTP id f1-20020a2e3801000000b0026ff8da5da9mr213877lja.238.1666082967164; Tue, 18 Oct 2022 01:49:27 -0700 (PDT) Received: from localhost.localdomain ([188.163.112.49]) by smtp.gmail.com with ESMTPSA id e10-20020a05651236ca00b004949f7cbb6esm1771890lfs.79.2022.10.18.01.49.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 01:49:26 -0700 (PDT) From: Svyatoslav Ryhel To: Linus Walleij , Bartosz Golaszewski , Thierry Reding , Jonathan Hunter , Dmitry Osipenko Cc: linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/2] gpio: tegra: Convert to immutable irq chip Date: Tue, 18 Oct 2022 11:49:04 +0300 Message-Id: <20221018084905.21717-2-clamor95@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221018084905.21717-1-clamor95@gmail.com> References: <20221018084905.21717-1-clamor95@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747015616973096084?= X-GMAIL-MSGID: =?utf-8?q?1747015616973096084?= Update the driver to use an immutable IRQ chip to fix this warning: "not an immutable chip, please consider fixing it!" Preserve per-chip labels by adding an ->irq_print_chip() callback. Tested-by: Svyatoslav Ryhel # TF201 T30 Tested-by: Robert Eckelmann # TF101 T20 Signed-off-by: Svyatoslav Ryhel Reviewed-by: Dmitry Osipenko --- Changes since V2: - use CONFIG_PM_SLEEP ifdefs Changes since V1: - Added tested-by info from testers - Patch itself is same, it had no review for 3 weeks - Test robot is triggering for pm_sleep_ptr, should not it be used to omit CONFIG_PM_SLEEP ifdefs? drivers/gpio/gpio-tegra.c | 60 ++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 16 deletions(-) diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index e4fb4cb38a0f..5b265a6fd3c1 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -94,7 +95,6 @@ struct tegra_gpio_info { struct tegra_gpio_bank *bank_info; const struct tegra_gpio_soc_config *soc; struct gpio_chip gc; - struct irq_chip ic; u32 bank_count; unsigned int *irqs; }; @@ -288,6 +288,7 @@ static void tegra_gpio_irq_mask(struct irq_data *d) unsigned int gpio = d->hwirq; tegra_gpio_mask_write(tgi, GPIO_MSK_INT_ENB(tgi, gpio), gpio, 0); + gpiochip_disable_irq(chip, gpio); } static void tegra_gpio_irq_unmask(struct irq_data *d) @@ -296,6 +297,7 @@ static void tegra_gpio_irq_unmask(struct irq_data *d) struct tegra_gpio_info *tgi = gpiochip_get_data(chip); unsigned int gpio = d->hwirq; + gpiochip_enable_irq(chip, gpio); tegra_gpio_mask_write(tgi, GPIO_MSK_INT_ENB(tgi, gpio), gpio, 1); } @@ -598,10 +600,47 @@ static void tegra_gpio_irq_release_resources(struct irq_data *d) tegra_gpio_enable(tgi, d->hwirq); } +static void tegra_gpio_irq_print_chip(struct irq_data *d, struct seq_file *s) +{ + struct gpio_chip *chip = irq_data_get_irq_chip_data(d); + + seq_printf(s, dev_name(chip->parent)); +} + +static const struct irq_chip tegra_gpio_irq_chip = { + .irq_shutdown = tegra_gpio_irq_shutdown, + .irq_ack = tegra_gpio_irq_ack, + .irq_mask = tegra_gpio_irq_mask, + .irq_unmask = tegra_gpio_irq_unmask, + .irq_set_type = tegra_gpio_irq_set_type, +#ifdef CONFIG_PM_SLEEP + .irq_set_wake = tegra_gpio_irq_set_wake, +#endif + .irq_print_chip = tegra_gpio_irq_print_chip, + .irq_request_resources = tegra_gpio_irq_request_resources, + .irq_release_resources = tegra_gpio_irq_release_resources, + .flags = IRQCHIP_IMMUTABLE, +}; + +static const struct irq_chip tegra210_gpio_irq_chip = { + .irq_shutdown = tegra_gpio_irq_shutdown, + .irq_ack = tegra_gpio_irq_ack, + .irq_mask = tegra_gpio_irq_mask, + .irq_unmask = tegra_gpio_irq_unmask, + .irq_set_affinity = tegra_gpio_irq_set_affinity, + .irq_set_type = tegra_gpio_irq_set_type, +#ifdef CONFIG_PM_SLEEP + .irq_set_wake = tegra_gpio_irq_set_wake, +#endif + .irq_print_chip = tegra_gpio_irq_print_chip, + .irq_request_resources = tegra_gpio_irq_request_resources, + .irq_release_resources = tegra_gpio_irq_release_resources, + .flags = IRQCHIP_IMMUTABLE, +}; + #ifdef CONFIG_DEBUG_FS #include -#include static int tegra_dbg_gpio_show(struct seq_file *s, void *unused) { @@ -689,18 +728,6 @@ static int tegra_gpio_probe(struct platform_device *pdev) tgi->gc.ngpio = tgi->bank_count * 32; tgi->gc.parent = &pdev->dev; - tgi->ic.name = "GPIO"; - tgi->ic.irq_ack = tegra_gpio_irq_ack; - tgi->ic.irq_mask = tegra_gpio_irq_mask; - tgi->ic.irq_unmask = tegra_gpio_irq_unmask; - tgi->ic.irq_set_type = tegra_gpio_irq_set_type; - tgi->ic.irq_shutdown = tegra_gpio_irq_shutdown; -#ifdef CONFIG_PM_SLEEP - tgi->ic.irq_set_wake = tegra_gpio_irq_set_wake; -#endif - tgi->ic.irq_request_resources = tegra_gpio_irq_request_resources; - tgi->ic.irq_release_resources = tegra_gpio_irq_release_resources; - platform_set_drvdata(pdev, tgi); if (tgi->soc->debounce_supported) @@ -733,7 +760,6 @@ static int tegra_gpio_probe(struct platform_device *pdev) } irq = &tgi->gc.irq; - irq->chip = &tgi->ic; irq->fwnode = of_node_to_fwnode(pdev->dev.of_node); irq->child_to_parent_hwirq = tegra_gpio_child_to_parent_hwirq; irq->populate_parent_alloc_arg = tegra_gpio_populate_parent_fwspec; @@ -752,7 +778,9 @@ static int tegra_gpio_probe(struct platform_device *pdev) if (!irq->parent_domain) return -EPROBE_DEFER; - tgi->ic.irq_set_affinity = tegra_gpio_irq_set_affinity; + gpio_irq_chip_set_chip(irq, &tegra210_gpio_irq_chip); + } else { + gpio_irq_chip_set_chip(irq, &tegra_gpio_irq_chip); } tgi->regs = devm_platform_ioremap_resource(pdev, 0); From patchwork Tue Oct 18 08:49:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Svyatoslav Ryhel X-Patchwork-Id: 4030 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1850321wrs; Tue, 18 Oct 2022 02:05:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5GVH3hTqwv64o1JD4aOOT4Ptl4yH1aOoZTmmzgZ+Ym7Y6SD5dmT8kkRitaYs7rRVpgTKMZ X-Received: by 2002:a17:906:eec9:b0:73d:c369:690f with SMTP id wu9-20020a170906eec900b0073dc369690fmr1562025ejb.767.1666083935511; Tue, 18 Oct 2022 02:05:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666083935; cv=none; d=google.com; s=arc-20160816; b=LDeB7Z3w9zJ3W8ITVP0V5XYdD3WeslrqX/59yD1ntKZ96tTKI3GJAY2n6JkMvLwUiC d98sp5jLFF2NCBZEfrtRk+WO/HZIEoVobMep2vUWeGs+NNWQe9kEwnYt36+nm0bKoMd4 MJ2BnwwJGs8NmnRWCfylWAzvD2UoXUEpXTfEwJjLqXoUDbkmC0PWhwoAmp5mXHt/msfA vs66TRHx+8Swjf4SnAkrinuHl2UVTj/uQ9oaukT8SBSEeIaX8PMBvsAtewTtGPmu65zo Sdukl3HicAwVY5OepgsdodJEfngev5BymCAaG2/zHWxUNmjt6UPPsQkJkB6ikeJi9zKV Pirw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=S11K4vBoZGON508rytYjLm5ClL9jYcwO7synKUjPE5g=; b=vk5QJekMmGaAeJYGEHwUmNoAUWHm5dGJg4Qdyxh/x+PaKm4T2tTjOVc0nwgQF7BN6v rj7bEK3f2oVxRX0Fn0h+ZifEFRe8TjFx1k+9NM4BFzO9luadSa1IBTKzFbIXHFLxads3 uuav/sb/jiHKtN95QMN6xWqrpIlrj/sMIHAdcZQwtYEIK0SsI4jQJLIk8QScY5ns3DoY Vgt3LOMGLIJMnsslp6jCSZKH/o3z4NnXIowtgSvOr6y6APwBkVUKJju7ordQmDybjlJk 9XaTT+bfpflXs9SEGYZ2zTHRPyr6q5wRxq1NzpC0CTfRC+qILborBFvSuVul8TQK64YR UcPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=f0NcEixT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa44-20020a17090786ac00b0078a10c159b4si11371385ejc.290.2022.10.18.02.05.10; Tue, 18 Oct 2022 02:05:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=f0NcEixT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231178AbiJRIuG (ORCPT + 99 others); Tue, 18 Oct 2022 04:50:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231153AbiJRIt5 (ORCPT ); Tue, 18 Oct 2022 04:49:57 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97AC5FAD4; Tue, 18 Oct 2022 01:49:29 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id h8so17010569lja.11; Tue, 18 Oct 2022 01:49:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=S11K4vBoZGON508rytYjLm5ClL9jYcwO7synKUjPE5g=; b=f0NcEixTYGOiFkW5GEnnTneNS4jwWS4EYYcTionijTwvaum39D+rS7wbM6VENJOl61 YNt/CM+RiaTh28efu7Y3tRH/YvJuseLjdBrutpYSwiSLbQRfcYdACpnL3jqKL6+XTcAO kV4DU83geA8e0ASM96bwoiRjGiXYH+LxJstVPLzkwgGAPIDDXPFJxMNtQ/BY4CF25Tab QrT26rabQ7maetDkzZUE4gjTfLgkDg7ru+61g0AD7wzVHI3XniaTG357bOh0QN/nukLo GQ/seikoPNOMWxq8AK2Mk9jKt399skq1703f64w/2Iih0ij9sA/WA8QK28vLWzzGO98k 4etw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S11K4vBoZGON508rytYjLm5ClL9jYcwO7synKUjPE5g=; b=OwlefIaBYMEW1MacG7wT95eYlYXhl+Dbg2c2pfBT25jCGQ+80vEGyMxggIDlEK5yoD ZpL9o+fJJf8MrTmHo9oqdQznw9Vx6u31GOVgqBfqyJxVw54EFNZKL4AcaiuW/02J62xH 8lqH5myYrxbY8rZOovaNqjSUe8hdqHl2U+0G6HwcHlqkU61L+1iUa7GpvJw6kwHWc1yK qpKd/+n6eTuk3Dasr9APqfN4mkANivevfXg8Czzc+PyB2+7m5oAbvF3Qqzmfn0cRgLNJ 6eKbkNsy6Bb/DyyNnq14a8Qjd/jmfvqTnSkIYo2GC7sbI9/+PqexbmP3MFFcn1LkbpUS SCHA== X-Gm-Message-State: ACrzQf2t0HNJSH9XnOiZyZ2JwmfLTRw/nH1uat0vcrnk5pztVNZksUlS Dx7woRHRI7NKdOnRctjCMzY= X-Received: by 2002:a2e:92d5:0:b0:26f:a674:94ac with SMTP id k21-20020a2e92d5000000b0026fa67494acmr704419ljh.470.1666082968143; Tue, 18 Oct 2022 01:49:28 -0700 (PDT) Received: from localhost.localdomain ([188.163.112.49]) by smtp.gmail.com with ESMTPSA id e10-20020a05651236ca00b004949f7cbb6esm1771890lfs.79.2022.10.18.01.49.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 01:49:27 -0700 (PDT) From: Svyatoslav Ryhel To: Linus Walleij , Bartosz Golaszewski , Thierry Reding , Jonathan Hunter , Dmitry Osipenko Cc: linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/2] gpio: tegra: Switch to new *_PM_OPS macros Date: Tue, 18 Oct 2022 11:49:05 +0300 Message-Id: <20221018084905.21717-3-clamor95@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221018084905.21717-1-clamor95@gmail.com> References: <20221018084905.21717-1-clamor95@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747015628822532974?= X-GMAIL-MSGID: =?utf-8?q?1747015628822532974?= Since SET_*_PM_OPS() were deprecated, switch to new *_PM_OPS. The callbacks that are only useful with CONFIG_PM_SLEEP is enabled, are now wrapped with a pm_sleep_ptr(). Signed-off-by: Svyatoslav Ryhel --- drivers/gpio/gpio-tegra.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index 5b265a6fd3c1..ce17cc1a1cab 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c @@ -461,7 +461,6 @@ static int tegra_gpio_populate_parent_fwspec(struct gpio_chip *chip, return 0; } -#ifdef CONFIG_PM_SLEEP static int tegra_gpio_resume(struct device *dev) { struct tegra_gpio_info *tgi = dev_get_drvdata(dev); @@ -569,7 +568,6 @@ static int tegra_gpio_irq_set_wake(struct irq_data *d, unsigned int enable) return 0; } -#endif static int tegra_gpio_irq_set_affinity(struct irq_data *data, const struct cpumask *dest, @@ -613,9 +611,7 @@ static const struct irq_chip tegra_gpio_irq_chip = { .irq_mask = tegra_gpio_irq_mask, .irq_unmask = tegra_gpio_irq_unmask, .irq_set_type = tegra_gpio_irq_set_type, -#ifdef CONFIG_PM_SLEEP - .irq_set_wake = tegra_gpio_irq_set_wake, -#endif + .irq_set_wake = pm_sleep_ptr(tegra_gpio_irq_set_wake), .irq_print_chip = tegra_gpio_irq_print_chip, .irq_request_resources = tegra_gpio_irq_request_resources, .irq_release_resources = tegra_gpio_irq_release_resources, @@ -629,9 +625,7 @@ static const struct irq_chip tegra210_gpio_irq_chip = { .irq_unmask = tegra_gpio_irq_unmask, .irq_set_affinity = tegra_gpio_irq_set_affinity, .irq_set_type = tegra_gpio_irq_set_type, -#ifdef CONFIG_PM_SLEEP - .irq_set_wake = tegra_gpio_irq_set_wake, -#endif + .irq_set_wake = pm_sleep_ptr(tegra_gpio_irq_set_wake), .irq_print_chip = tegra_gpio_irq_print_chip, .irq_request_resources = tegra_gpio_irq_request_resources, .irq_release_resources = tegra_gpio_irq_release_resources, @@ -681,7 +675,7 @@ static inline void tegra_gpio_debuginit(struct tegra_gpio_info *tgi) #endif static const struct dev_pm_ops tegra_gpio_pm_ops = { - SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(tegra_gpio_suspend, tegra_gpio_resume) + NOIRQ_SYSTEM_SLEEP_PM_OPS(tegra_gpio_suspend, tegra_gpio_resume) }; static const struct of_device_id tegra_pmc_of_match[] = {