Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp502180ybl; Tue, 7 Jan 2020 09:50:09 -0800 (PST) X-Google-Smtp-Source: APXvYqwNRJ6zUDBasljg/khWSx0klWGYh/jGiNenWteFvOutUCrV1Cx4C+ejk7C2OF+HF8TdfAji X-Received: by 2002:a9d:798e:: with SMTP id h14mr908831otm.257.1578419409861; Tue, 07 Jan 2020 09:50:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578419409; cv=none; d=google.com; s=arc-20160816; b=Cf7h6iUFW+9kMzUeMtG5OFzOvakUR+21bmiSoYqebLbm4zaoPUkb6BT8Nm/K9mq6DL xKasfk6cU07qkT35T7L4gUbjdbBZI4Qje4riE9gRYNd9qq4T33UcBJz6sNCFztrUT/Y8 pEoVwpFc5x1aZgF9MMNeWVAagVHOEixUEkeUbgnChgH5DEkDhjsGmdOPxgxzTSKjWfZp khsxWyfoE65OcQVotTWYmcolDozhN4l29UtBrBOXXmzOtF5DQo0xCnoAa+VCax9zgmIP RUweCAT+Ox949XrtAuhskp8piry6N3/4OmGbKLA3ghhXbB1NUfpKcWUbaTowm5rexcTg 0GKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=kCbTChaL23MXe/w+jC6iDlDOG+nRxSCUHAsyN+fR5Zo=; b=VbHV0QBeUePKtlIBu87CYcfTGbpeQpYQKdkPxUWCW4L9aGDktWGzkF1Qs4i+UiuskG l5QafWDbOsyb2m3X3Q0sn2n5jZ7RtBXhOFGDr1k84H1sh5lQ0pEmHte7fASNqmpZFuSW QtRGYtsb9yOdNdxWDe7Pq0eA8+19mCJ+8Y3gybsPi1i8HWpu0sNV7ygrJkPHKma8Fyat ky1pe8il6HKRthveuTvj5PvL6YhMnJ89oGxNyjY8sMd/Wo2s5WUlgJnm1iDYESl2Zhph DI5NRJA2lzaJKSK5BS5eJhDyvXs87C5Ldz0BLIrT0awhlxWtv2fpbN+pww72GePbqGCl qGCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x26si313434oie.73.2020.01.07.09.49.57; Tue, 07 Jan 2020 09:50:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728607AbgAGRsY (ORCPT + 99 others); Tue, 7 Jan 2020 12:48:24 -0500 Received: from sauhun.de ([88.99.104.3]:53350 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728564AbgAGRsV (ORCPT ); Tue, 7 Jan 2020 12:48:21 -0500 Received: from localhost (p5486CF8B.dip0.t-ipconnect.de [84.134.207.139]) by pokefinder.org (Postfix) with ESMTPSA id 7B2502C3961; Tue, 7 Jan 2020 18:48:20 +0100 (CET) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: Wolfram Sang , Wolfram Sang , linux-kernel@vger.kernel.org Subject: [PATCH 09/12] i2c: i2c-core-base: convert to use i2c_new_client_device() Date: Tue, 7 Jan 2020 18:47:43 +0100 Message-Id: <20200107174748.9616-10-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200107174748.9616-1-wsa+renesas@sang-engineering.com> References: <20200107174748.9616-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move away from the deprecated API and return the shiny new ERRPTR where useful. Signed-off-by: Wolfram Sang --- Build tested only. drivers/i2c/i2c-core-base.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 9f8dcd3f8385..6c2007a015f2 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -824,8 +824,8 @@ EXPORT_SYMBOL_GPL(i2c_new_device); /** - * i2c_unregister_device - reverse effect of i2c_new_device() - * @client: value returned from i2c_new_device() + * i2c_unregister_device - reverse effect of i2c_new_*_device() + * @client: value returned from i2c_new_*_device() * Context: can sleep */ void i2c_unregister_device(struct i2c_client *client) @@ -1171,9 +1171,8 @@ static void i2c_scan_static_board_info(struct i2c_adapter *adapter) down_read(&__i2c_board_lock); list_for_each_entry(devinfo, &__i2c_board_list, list) { - if (devinfo->busnum == adapter->nr - && !i2c_new_device(adapter, - &devinfo->board_info)) + if (devinfo->busnum == adapter->nr && + IS_ERR(i2c_new_client_device(adapter, &devinfo->board_info))) dev_err(&adapter->dev, "Can't create device at 0x%02x\n", devinfo->board_info.addr); @@ -2160,8 +2159,8 @@ static int i2c_detect_address(struct i2c_client *temp_client, dev_dbg(&adapter->dev, "Creating %s at 0x%02x\n", info.type, info.addr); - client = i2c_new_device(adapter, &info); - if (client) + client = i2c_new_client_device(adapter, &info); + if (!IS_ERR(client)) list_add_tail(&client->detected, &driver->clients); else dev_err(&adapter->dev, "Failed creating %s at 0x%02x\n", -- 2.20.1