From patchwork Mon May 4 12:55:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 11525817 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4B78715E6 for ; Mon, 4 May 2020 12:56:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E0402075E for ; Mon, 4 May 2020 12:56:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="dpE6kZyt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727783AbgEDM4D (ORCPT ); Mon, 4 May 2020 08:56:03 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:54837 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726351AbgEDM4D (ORCPT ); Mon, 4 May 2020 08:56:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588596962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=3IyWgTOMXjHOmy2ereqicnSHpo+TKRD9Jy/hue5zjes=; b=dpE6kZytu70EmHCt4ZitCiZ7ikshQtpA9+f/AHUV+1wqaZfBQU6TFO6wDFGB83kjY59Qfp uCLXMmj9FO/wzPw+C6nWzHxjdWgQglIioBG3U6RqoPjftUFZrvgPHqPET3f6RWuFm0Z5IN hXHPcI4K3HRSYOdtFZVwEegKuy/xIjs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-52-llUa-5xNNqK2I1daWIMIhA-1; Mon, 04 May 2020 08:56:00 -0400 X-MC-Unique: llUa-5xNNqK2I1daWIMIhA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7B4A064ACA; Mon, 4 May 2020 12:55:58 +0000 (UTC) Received: from x1.localdomain.com (ovpn-114-224.ams2.redhat.com [10.36.114.224]) by smtp.corp.redhat.com (Postfix) with ESMTP id 060A25D97D; Mon, 4 May 2020 12:55:52 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" , Len Brown , Darren Hart , Andy Shevchenko , Jonathan Cameron Cc: Hans de Goede , linux-acpi@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org Subject: [PATCH v4 01/11] iio: light: cm32181: Switch to new style i2c-driver probe function Date: Mon, 4 May 2020 14:55:41 +0200 Message-Id: <20200504125551.434647-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Switch to the new style i2c-driver probe_new probe function and drop the unnecessary i2c_device_id table (we do not have any old style board files using this). This is a preparation patch for adding ACPI binding support. Signed-off-by: Hans de Goede --- Changes in v4: - Set indio_dev->name to "cm32181" instead of setting it to dev_name(dev) Changes in v3: - This is a new patch in v3 of this patch-set --- drivers/iio/light/cm32181.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/iio/light/cm32181.c b/drivers/iio/light/cm32181.c index 5f4fb5674fa0..2c139d85ef0c 100644 --- a/drivers/iio/light/cm32181.c +++ b/drivers/iio/light/cm32181.c @@ -294,8 +294,7 @@ static const struct iio_info cm32181_info = { .attrs = &cm32181_attribute_group, }; -static int cm32181_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static int cm32181_probe(struct i2c_client *client) { struct cm32181_chip *cm32181; struct iio_dev *indio_dev; @@ -316,7 +315,7 @@ static int cm32181_probe(struct i2c_client *client, indio_dev->channels = cm32181_channels; indio_dev->num_channels = ARRAY_SIZE(cm32181_channels); indio_dev->info = &cm32181_info; - indio_dev->name = id->name; + indio_dev->name = "cm32181"; indio_dev->modes = INDIO_DIRECT_MODE; ret = cm32181_reg_init(cm32181); @@ -338,13 +337,6 @@ static int cm32181_probe(struct i2c_client *client, return 0; } -static const struct i2c_device_id cm32181_id[] = { - { "cm32181", 0 }, - { } -}; - -MODULE_DEVICE_TABLE(i2c, cm32181_id); - static const struct of_device_id cm32181_of_match[] = { { .compatible = "capella,cm32181" }, { } @@ -356,8 +348,7 @@ static struct i2c_driver cm32181_driver = { .name = "cm32181", .of_match_table = of_match_ptr(cm32181_of_match), }, - .id_table = cm32181_id, - .probe = cm32181_probe, + .probe_new = cm32181_probe, }; module_i2c_driver(cm32181_driver);