From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8332FC43461 for ; Thu, 10 Sep 2020 17:36:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1DFFE221E3 for ; Thu, 10 Sep 2020 17:36:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759412; bh=y4RBhMExWqZsbDmxczqshbG9Lc9AJxW8KSELyxL6VRk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=vWLJ4G0OR3Jh7LH+zvrsnDPCJUyWkbBR36el2TBEIx2BGOTrKW1wMBrgSohVRu8a5 QOCYZ0TaLxOaDITbg09gmoYoZW18zUw0WPclu8qmfL181IqjKa5mMF4XpW7ZmMF9UV EpYsPCuqB15WeAMdfjZYlJiYTf/LOM2rP1fJ0Kys= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727825AbgIJRgX (ORCPT ); Thu, 10 Sep 2020 13:36:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:47866 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727101AbgIJRfs (ORCPT ); Thu, 10 Sep 2020 13:35:48 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C21F8221E3; Thu, 10 Sep 2020 17:35:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759320; bh=y4RBhMExWqZsbDmxczqshbG9Lc9AJxW8KSELyxL6VRk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OHKWdpXcOjJyEatjyckdI8lDGFNPo19n4c/Y53y89YZJuQLi6N9f7FrygX32GD9oM JtGguuq4Vn18IarrDK3vc6u/BXzNbVs6YOPIhzXILbnuCI2TKcnRnd4RJ08UZ+W+TK o+7XkJR98wUCmTdmd2k0WU1TFevHJ3IzSrwJ4HGk= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Peter Rosin Subject: [PATCH 06/38] iio:potentiometer:mcp4018: Drop of_match_ptr and CONFIG_OF protections. Date: Thu, 10 Sep 2020 18:32:10 +0100 Message-Id: <20200910173242.621168-7-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron These prevent use of this driver with ACPI via PRP0001 and are an example of an anti pattern I'm trying to remove from IIO. Also use device_get_match_data() rather than devicetree only version. Signed-off-by: Jonathan Cameron Cc: Peter Rosin --- drivers/iio/potentiometer/mcp4018.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/iio/potentiometer/mcp4018.c b/drivers/iio/potentiometer/mcp4018.c index fd0579ad3c83..c0e171fec062 100644 --- a/drivers/iio/potentiometer/mcp4018.c +++ b/drivers/iio/potentiometer/mcp4018.c @@ -16,8 +16,8 @@ #include #include #include -#include -#include +#include +#include #define MCP4018_WIPER_MAX 127 @@ -116,8 +116,6 @@ static const struct i2c_device_id mcp4018_id[] = { }; MODULE_DEVICE_TABLE(i2c, mcp4018_id); -#ifdef CONFIG_OF - #define MCP4018_COMPATIBLE(of_compatible, cfg) { \ .compatible = of_compatible, \ .data = &mcp4018_cfg[cfg], \ @@ -140,8 +138,6 @@ static const struct of_device_id mcp4018_of_match[] = { }; MODULE_DEVICE_TABLE(of, mcp4018_of_match); -#endif - static int mcp4018_probe(struct i2c_client *client) { struct device *dev = &client->dev; @@ -161,7 +157,7 @@ static int mcp4018_probe(struct i2c_client *client) i2c_set_clientdata(client, indio_dev); data->client = client; - data->cfg = of_device_get_match_data(dev); + data->cfg = device_get_match_data(dev); if (!data->cfg) data->cfg = &mcp4018_cfg[i2c_match_id(mcp4018_id, client)->driver_data]; @@ -176,7 +172,7 @@ static int mcp4018_probe(struct i2c_client *client) static struct i2c_driver mcp4018_driver = { .driver = { .name = "mcp4018", - .of_match_table = of_match_ptr(mcp4018_of_match), + .of_match_table = mcp4018_of_match, }, .probe_new = mcp4018_probe, .id_table = mcp4018_id, -- 2.28.0