Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2220040/?format=api
{ "id": 2220040, "url": "http://patchwork.ozlabs.org/api/patches/2220040/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260405-ti-ads7950-facelift-v5-4-1f980ed3cf9e@gmail.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": "<20260405-ti-ads7950-facelift-v5-4-1f980ed3cf9e@gmail.com>", "list_archive_url": null, "date": "2026-04-06T04:39:26", "name": "[v5,4/4] iio: adc: ti-ads7950: complete conversion to using managed resources", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "6b22e5ad4f7211371e9ef5f62574723da5f260e2", "submitter": { "id": 695, "url": "http://patchwork.ozlabs.org/api/people/695/?format=api", "name": "Dmitry Torokhov", "email": "dmitry.torokhov@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260405-ti-ads7950-facelift-v5-4-1f980ed3cf9e@gmail.com/mbox/", "series": [ { "id": 498820, "url": "http://patchwork.ozlabs.org/api/series/498820/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/list/?series=498820", "date": "2026-04-06T04:39:22", "name": "ti-ads7950: fix gpio handling and facelift", "version": 5, "mbox": "http://patchwork.ozlabs.org/series/498820/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2220040/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2220040/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-gpio+bounces-34697-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-gpio@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=VybCdcSP;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=104.64.211.4; helo=sin.lore.kernel.org;\n envelope-from=linux-gpio+bounces-34697-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=\"VybCdcSP\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=74.125.82.47", "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=gmail.com" ], "Received": [ "from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fpxT018NVz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 06 Apr 2026 14:40:04 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id EC2EF3007203\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 6 Apr 2026 04:39:43 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 9704530FC0F;\n\tMon, 6 Apr 2026 04:39:43 +0000 (UTC)", "from mail-dl1-f47.google.com (mail-dl1-f47.google.com\n [74.125.82.47])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 71CDC3290AA\n\tfor <linux-gpio@vger.kernel.org>; Mon, 6 Apr 2026 04:39:37 +0000 (UTC)", "by mail-dl1-f47.google.com with SMTP id\n a92af1059eb24-12a74039dc6so2519247c88.0\n for <linux-gpio@vger.kernel.org>;\n Sun, 05 Apr 2026 21:39:37 -0700 (PDT)", "from dtor-ws.sjc.corp.google.com\n ([2a00:79e0:2ebe:8:fe13:98b9:9e98:d1bb])\n by smtp.gmail.com with ESMTPSA id\n a92af1059eb24-12bed93f861sm15182005c88.0.2026.04.05.21.39.34\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sun, 05 Apr 2026 21:39:34 -0700 (PDT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775450383; cv=none;\n b=E4nkpWgavkyDERx7nLnVKkmQ2fhFbydlhMDdrEbZmm/+Ag97927ZVO/bWVeemYkKBpx13ZHT+sxYEafHN8preJpGVuhKrKWHmu2xfJt2jtadTou+eyJZqwe2CoScvfJ1RNMm8QxF9kYYRsK6xiS1maitQrY7qlTLHgZIndcQ8Qk=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775450383; c=relaxed/simple;\n\tbh=q1ErVgV21ILDuUcdhUgtkkx+/oTMzLm9AIurDmszr/g=;\n\th=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:\n\t In-Reply-To:To:Cc;\n b=a2qxlP6F22ngwpow8SqJrL1iJ2vleelzUjzHb7MKuUuR1W7WdBTVB8nCv3CgBNcyFhmNYPu7gPq50VZQbjzFAV+hxWRxtV69x+0/4BnKqbjjO2PQGfkPr61ceMAcOWnPte8TBAV2jHwbi4HUStTxN/UxG0xy3wN+29oDbLc8Ens=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com;\n spf=pass smtp.mailfrom=gmail.com;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=VybCdcSP; arc=none smtp.client-ip=74.125.82.47", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1775450376; x=1776055176;\n darn=vger.kernel.org;\n h=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n :mime-version:subject:date:from:from:to:cc:subject:date:message-id\n :reply-to;\n bh=muAbhbsfMeNqO7iyxZwi7/vPm//pj1ujL1kw3AyjdRw=;\n b=VybCdcSPDY3l8Sdjo4ZN7cbq2f87d0EGqYZ0p3gLfuWSf5tzRsPZEpP/jAYnpYBhxI\n fdDZvi9Y7od3B/wUNsP+X+XCsaVuBFwCMaRKXIVteOX56zp1wxq/PbOHqwPajucC66Rf\n Cm52vQsMife9df5FFJGDrf7YvG9aLeZyO0SFM82icX7p60A3J88Z9Vbw5ZLYzDEnsyl5\n Z8M73TOrfL/4Da/+J76ScnaXQ2GdPR6/wGz+ydODIh4wrBR8z4fpEgmPrKaAW01WhEkO\n pcIKN8jpdtDmuwYGns3XjG0LnzyY/lmIUeW9a4xyQeHoDeOhZk69HhEZCg7rlfaa2+NH\n qwbw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775450376; x=1776055176;\n h=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to\n :cc:subject:date:message-id:reply-to;\n bh=muAbhbsfMeNqO7iyxZwi7/vPm//pj1ujL1kw3AyjdRw=;\n b=g9lk5jO8wnyKTIeJcFNNZA/FfZ4zeGPEJORciOfNfpLhJs9BYuCZ0wg4/avtuEKlXP\n QmahsF3gHVREMrZ1Dq9FNVzYVZ9rrP6pGwbZuLem9ueq1X37Kmr4sQjqW2srME0xli1p\n A0DlxY5p3qrtVbAZS2+DsLmCrQA/KUqyQJJkxKsBwKdee2GRdWHMtzyruz0xyVEsMMMf\n rjOshQNRWAE+YbMWCunBrG0NdThobqoXavtwt/MGF9GmntinqvosyPUrvca2HvHWLN4X\n 5v7U2DSlZChgACFCthPJQ/uGg/fTIH+vJooLjvyRs72oj8W7X+vXULUH7B0RwzwSSdAd\n w+Mw==", "X-Forwarded-Encrypted": "i=1;\n AJvYcCW8y5yPvBZrjwDDaVAuaBuTt4Yx5U0gQdGNW03hl8zm/IeGJEoRU4z2Bu9jrhnoHoh1mJiyilNv/lSn@vger.kernel.org", "X-Gm-Message-State": "AOJu0YywsiHxUR75yY+2TD8A2WTREcv9G3LhuO08XUjlnezXXq4lbYLm\n\t+ySlK1tf4OJ46L+/s9wIzYAxcgCXYGA4vSSG2ZwMBiomYNI9N0yIPXXy", "X-Gm-Gg": "AeBDievzVX6+CTaeOoHo12xclSGYjoqDH1UFDDuxABxgBo0J0MfbkBmrSe1r4ZjGLuJ\n\tP+ClSmwBH300k1nmihDNF1KQ/l+v/PpXpI2S84ZblG15PsVGAQgSPzuX76UTz40aC4/vbmfrrwd\n\tZB42oogJHmtCD333xmnfBbTNd7G6thrrlInV11IZPV5xtvNHYEoUbXg1n7dkxAlp/S0tYdAhFWH\n\t8Mm3RrZnnSbzpsoA9S8GOQigRgFCdQpVfCqRW1aqoeAV4O5b/1eql0hE+BssskaVEvOLCzc0XUo\n\ts3ICzfKS7hsHdiLOthlUqVbCerlJi7W4X8NED1es0Vd8P45+a9ZynIkhRcNKcbtqfP8ZaYfnKRk\n\tPFULNEPcXMpKqsHr2ls6mU/TBrlyT+BI//2midSz0pLKq5SEjq0BnrF/8gnDyWow0u/suAXKaaq\n\tOXKMG79qprTufGYKg+N4BXWpi3fsfBIOvKHzXLBvWhD1pdS8PmfX1uXXLa/SU43lH/uBwbZBOpr\n\tQ21W/2lV+xFeKU=", "X-Received": "by 2002:a05:7022:e02:b0:12b:f881:d8d0 with SMTP id\n a92af1059eb24-12bfb7459f4mr5048040c88.18.1775450376503;\n Sun, 05 Apr 2026 21:39:36 -0700 (PDT)", "From": "Dmitry Torokhov <dmitry.torokhov@gmail.com>", "Date": "Sun, 05 Apr 2026 21:39:26 -0700", "Subject": "[PATCH v5 4/4] iio: adc: ti-ads7950: complete conversion to using\n managed resources", "Precedence": "bulk", "X-Mailing-List": "linux-gpio@vger.kernel.org", "List-Id": "<linux-gpio.vger.kernel.org>", "List-Subscribe": "<mailto:linux-gpio+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-gpio+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "7bit", "Message-Id": "<20260405-ti-ads7950-facelift-v5-4-1f980ed3cf9e@gmail.com>", "References": "<20260405-ti-ads7950-facelift-v5-0-1f980ed3cf9e@gmail.com>", "In-Reply-To": "<20260405-ti-ads7950-facelift-v5-0-1f980ed3cf9e@gmail.com>", "To": "Jonathan Cameron <jic23@kernel.org>,\n David Lechner <dlechner@baylibre.com>", "Cc": "=?utf-8?q?Nuno_S=C3=A1?= <nuno.sa@analog.com>,\n Andy Shevchenko <andy@kernel.org>, Linus Walleij <linusw@kernel.org>,\n Bartosz Golaszewski <brgl@kernel.org>, linux-iio@vger.kernel.org,\n linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,\n Jonathan Cameron <Jonathan.Cameron@huawei.com>", "X-Mailer": "b4 0.16-dev-6911d" }, "content": "All resources that the driver needs have managed API now. Switch to\nusing them to make code clearer and drop ti_ads7950_remove().\n\nReviewed-by: David Lechner <dlechner@baylibre.com>\nSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>\n---\n drivers/iio/adc/ti-ads7950.c | 70 ++++++++++++++------------------------------\n 1 file changed, 22 insertions(+), 48 deletions(-)", "diff": "diff --git a/drivers/iio/adc/ti-ads7950.c b/drivers/iio/adc/ti-ads7950.c\nindex 0b98c8e7385d..882b280d9e0b 100644\n--- a/drivers/iio/adc/ti-ads7950.c\n+++ b/drivers/iio/adc/ti-ads7950.c\n@@ -506,10 +506,8 @@ static int ti_ads7950_probe(struct spi_device *spi)\n \tspi->bits_per_word = 16;\n \tspi->mode |= SPI_CS_WORD;\n \tret = spi_setup(spi);\n-\tif (ret) {\n-\t\tdev_err(&spi->dev, \"Error in spi setup\\n\");\n-\t\treturn ret;\n-\t}\n+\tif (ret)\n+\t\treturn dev_err_probe(&spi->dev, ret, \"Error in spi setup\\n\");\n \n \tindio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));\n \tif (!indio_dev)\n@@ -517,8 +515,6 @@ static int ti_ads7950_probe(struct spi_device *spi)\n \n \tst = iio_priv(indio_dev);\n \n-\tspi_set_drvdata(spi, indio_dev);\n-\n \tst->spi = spi;\n \n \tinfo = spi_get_device_match_data(spi);\n@@ -559,7 +555,9 @@ static int ti_ads7950_probe(struct spi_device *spi)\n \tspi_message_init_with_transfers(&st->scan_single_msg,\n \t\t\t\t\tst->scan_single_xfer, 3);\n \n-\tmutex_init(&st->slock);\n+\tret = devm_mutex_init(&spi->dev, &st->slock);\n+\tif (ret)\n+\t\treturn ret;\n \n \t/* Use hard coded value for reference voltage in ACPI case */\n \tif (ACPI_COMPANION(&spi->dev)) {\n@@ -573,24 +571,22 @@ static int ti_ads7950_probe(struct spi_device *spi)\n \t\tst->vref_mv = ret / 1000;\n \t}\n \n-\tret = iio_triggered_buffer_setup(indio_dev, NULL,\n-\t\t\t\t\t &ti_ads7950_trigger_handler, NULL);\n-\tif (ret) {\n-\t\tdev_err(&spi->dev, \"Failed to setup triggered buffer\\n\");\n-\t\tgoto error_destroy_mutex;\n-\t}\n+\tret = devm_iio_triggered_buffer_setup(&spi->dev, indio_dev, NULL,\n+\t\t\t\t\t &ti_ads7950_trigger_handler,\n+\t\t\t\t\t NULL);\n+\tif (ret)\n+\t\treturn dev_err_probe(&spi->dev, ret,\n+\t\t\t\t \"Failed to setup triggered buffer\\n\");\n \n \tret = ti_ads7950_init_hw(st);\n-\tif (ret) {\n-\t\tdev_err(&spi->dev, \"Failed to init adc chip\\n\");\n-\t\tgoto error_cleanup_ring;\n-\t}\n+\tif (ret)\n+\t\treturn dev_err_probe(&spi->dev, ret,\n+\t\t\t\t \"Failed to init adc chip\\n\");\n \n-\tret = iio_device_register(indio_dev);\n-\tif (ret) {\n-\t\tdev_err(&spi->dev, \"Failed to register iio device\\n\");\n-\t\tgoto error_cleanup_ring;\n-\t}\n+\tret = devm_iio_device_register(&spi->dev, indio_dev);\n+\tif (ret)\n+\t\treturn dev_err_probe(&spi->dev, ret,\n+\t\t\t\t \"Failed to register iio device\\n\");\n \n \t/* Add GPIO chip */\n \tst->chip.label = dev_name(&st->spi->dev);\n@@ -605,33 +601,12 @@ static int ti_ads7950_probe(struct spi_device *spi)\n \tst->chip.get = ti_ads7950_get;\n \tst->chip.set = ti_ads7950_set;\n \n-\tret = gpiochip_add_data(&st->chip, st);\n-\tif (ret) {\n-\t\tdev_err(&spi->dev, \"Failed to init GPIOs\\n\");\n-\t\tgoto error_iio_device;\n-\t}\n+\tret = devm_gpiochip_add_data(&spi->dev, &st->chip, st);\n+\tif (ret)\n+\t\treturn dev_err_probe(&spi->dev, ret,\n+\t\t\t\t \"Failed to init GPIOs\\n\");\n \n \treturn 0;\n-\n-error_iio_device:\n-\tiio_device_unregister(indio_dev);\n-error_cleanup_ring:\n-\tiio_triggered_buffer_cleanup(indio_dev);\n-error_destroy_mutex:\n-\tmutex_destroy(&st->slock);\n-\n-\treturn ret;\n-}\n-\n-static void ti_ads7950_remove(struct spi_device *spi)\n-{\n-\tstruct iio_dev *indio_dev = spi_get_drvdata(spi);\n-\tstruct ti_ads7950_state *st = iio_priv(indio_dev);\n-\n-\tgpiochip_remove(&st->chip);\n-\tiio_device_unregister(indio_dev);\n-\tiio_triggered_buffer_cleanup(indio_dev);\n-\tmutex_destroy(&st->slock);\n }\n \n static const struct spi_device_id ti_ads7950_id[] = {\n@@ -674,7 +649,6 @@ static struct spi_driver ti_ads7950_driver = {\n \t\t.of_match_table = ads7950_of_table,\n \t},\n \t.probe\t\t= ti_ads7950_probe,\n-\t.remove\t\t= ti_ads7950_remove,\n \t.id_table\t= ti_ads7950_id,\n };\n module_spi_driver(ti_ads7950_driver);\n", "prefixes": [ "v5", "4/4" ] }