Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp83781rbe; Wed, 28 Feb 2024 12:59:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWFsa5hwt2Ld/ZAs9HMexoMWOKhuf8wT/qsjwV1WJGF73bzIZsEdhf8V6wmf2VsmuMWw1KHhbtZQPrTb2biEgLmAqF1OBVnibyjr8VIIQ== X-Google-Smtp-Source: AGHT+IH6bD3V6akimBs2oW7ihutX3/rKJsrOXuINwg8QAmpquyrHedNYTownVsGCbZz8z8VcNoNB X-Received: by 2002:a05:620a:46ab:b0:787:f16b:e49 with SMTP id bq43-20020a05620a46ab00b00787f16b0e49mr743664qkb.14.1709153981210; Wed, 28 Feb 2024 12:59:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709153981; cv=pass; d=google.com; s=arc-20160816; b=pcRufnEJUHqFM75qnvhYNiFW9MWF63B2qg2nTd3s8BoZVTV6Ueon0HrkzezBDF0+Ep 1MyH/g7v7rP0pw3R+hU0qn6xUVql1OYBsTCuUb3mUlEx4GqfNsi5KoAgX7/xthnPfmXo Ac6NvNKCjoochpLuzwCE77+VETqU4Dq2+E99xjzzDbFTSKT1RaKQnJWJLuOYC10mbqUK 3UycqrpPkSnDnpeCNek8xo70qTEaSAg15fU+fQc0sDDsuUBTuN65/jY5KyGoJYqZwtYB Y3zxPzCI8ihGhU4cTNkr6T5X1caVDGxqKloYgmj+dJI+I+qNTYW6zsNVwauldr14RHrY HvIA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=2uoCwNKAS3qAe4fwqTUGn8CGf4IFqjRUOpQo9rweM7g=; fh=B/lAw/RZiW2xJ92yiMBaVyzsPyn+5aUdj7gFMmX3Ig0=; b=sacpSD000WYbDOvpiDkkKXdFIYJdQnSYBXcGYRTMPeuCIUFqtoZIe4Osixb2Vki/b7 GYvHni9ntp/DCh7bGqIIUkZwAwmsRfqApRqz1SxCq+bDbHO9c8rK8mW6sj9sEkU4J4hr m70KudAtnUwEYnM739zPgHrVGhCbdwUz0uEFj4cSm9+qxOB54peK3ZHhEs18DRclJ3Kb y53iLrNopUR6CoK+fqSSlTfsWZmQUTAEX2OdZ9y7ktGBIzPJt0iya+o59hoSlRzPfDja KNxQYnKF0G5wGMJZO+P6BsWTz2dHjwnDsIrGQewszkyRxyr6+7z5+qglxHXz06X7Vuk5 2mBQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LH6m4Epl; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-85701-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85701-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id i4-20020a05620a144400b00783ab5f86adsi331982qkl.265.2024.02.28.12.59.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 12:59:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85701-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LH6m4Epl; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-85701-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85701-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A68F71C24773 for ; Wed, 28 Feb 2024 20:59:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2C1F18625A; Wed, 28 Feb 2024 20:59:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="LH6m4Epl" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (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 DAAA186245; Wed, 28 Feb 2024 20:59:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709153973; cv=none; b=W4Ph33ifJ2Dc99ROkNNLV4reXYj4/qej0czX/JRAdOABMUo2SWT7VZ8k+qCIyVaubD1UtcJqcNcbN7QYCokHIh+xIrrB/x78rq9MNHb4s2VH7U4qSVnBTdFpupZ+7wvkyAoVGbsuNCCiB4NTK/1E2gDqOeRJu320mPcdvb4zqrQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709153973; c=relaxed/simple; bh=s1h62JPTJyLTei5gZpaIUHL0sKAJLHq8C1bsqb1sRxM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=RIQ+2Pm4TtDD40WQAcWFBz+eIBCXqeZ6hlI7R6bYtbf4qhu9Vih26b6rWP1VjTJiz2vWEfUI5frIs9EISDln6oOF1NjrN+pm0GtjCFADvPRacUG85/d+e4e9S5j2WfKEEBaFg9gQ2cd821qewFhSLJv4hSopBJG7/n3vQ90l1x4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=LH6m4Epl; arc=none smtp.client-ip=192.198.163.17 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709153972; x=1740689972; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=s1h62JPTJyLTei5gZpaIUHL0sKAJLHq8C1bsqb1sRxM=; b=LH6m4EplhJRfcFTVloQecUPRx89ZpOAKOYAsLmyiOb5UQAa/7BpwqvSd sP2ua0ncgh6IpGk+FvxYKwNzzP+QgXJliMYsWR8IAbR/xTgNmcqh8d8uu 0h0L/sMzLiBq6rPp5FUzCwI+LKdng0OL5usAF1EdObb8J7fYYrq/mk45a pM/5C/eYxas4cEX8Et0+MRaBtE+rIQGZtvzs+ny094JwY8WDrUeLHn8lE RFGZIA2jaNCMtSX5V9yVe5khnodcQgIsuN+9YQR2WKc9buBUtkVN2FVfX v2dSDVqpCjQtmy3n582nwExUNPcQY/6irtj8BESfgJNxqvYvAd579LGa1 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10998"; a="3430170" X-IronPort-AV: E=Sophos;i="6.06,191,1705392000"; d="scan'208";a="3430170" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2024 12:59:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10998"; a="937034667" X-IronPort-AV: E=Sophos;i="6.06,191,1705392000"; d="scan'208";a="937034667" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 28 Feb 2024 12:59:29 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 59F691C5; Wed, 28 Feb 2024 22:59:28 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen Subject: [PATCH v1 1/1] iio: adc: twl4030-madc: Make use of device properties Date: Wed, 28 Feb 2024 22:59:27 +0200 Message-ID: <20240228205927.3681321-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Include mod_devicetable.h explicitly to replace the dropped of.h which included mod_devicetable.h indirectly. Signed-off-by: Andy Shevchenko --- drivers/iio/adc/twl4030-madc.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/iio/adc/twl4030-madc.c b/drivers/iio/adc/twl4030-madc.c index 4a247ca25a44..a7b6b81014de 100644 --- a/drivers/iio/adc/twl4030-madc.c +++ b/drivers/iio/adc/twl4030-madc.c @@ -19,10 +19,12 @@ #include #include #include +#include +#include #include +#include #include #include -#include #include #include #include @@ -30,7 +32,6 @@ #include #include #include -#include #include #include @@ -746,7 +747,6 @@ static int twl4030_madc_probe(struct platform_device *pdev) { struct twl4030_madc_data *madc; struct twl4030_madc_platform_data *pdata = dev_get_platdata(&pdev->dev); - struct device_node *np = pdev->dev.of_node; int irq, ret; u8 regval; struct iio_dev *iio_dev = NULL; @@ -779,7 +779,7 @@ static int twl4030_madc_probe(struct platform_device *pdev) if (pdata) madc->use_second_irq = (pdata->irq_line != 1); else - madc->use_second_irq = of_property_read_bool(np, + madc->use_second_irq = device_property_read_bool(&pdev->dev, "ti,system-uses-second-madc-irq"); madc->imr = madc->use_second_irq ? TWL4030_MADC_IMR2 : @@ -905,20 +905,18 @@ static void twl4030_madc_remove(struct platform_device *pdev) regulator_disable(madc->usb3v1); } -#ifdef CONFIG_OF static const struct of_device_id twl_madc_of_match[] = { { .compatible = "ti,twl4030-madc", }, - { }, + { } }; MODULE_DEVICE_TABLE(of, twl_madc_of_match); -#endif static struct platform_driver twl4030_madc_driver = { .probe = twl4030_madc_probe, .remove_new = twl4030_madc_remove, .driver = { .name = "twl4030_madc", - .of_match_table = of_match_ptr(twl_madc_of_match), + .of_match_table = twl_madc_of_match, }, }; -- 2.43.0.rc1.1.gbec44491f096