Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp618816pxb; Tue, 1 Feb 2022 07:07:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJy9dD0qwhOJyvQcPqtWpy9JQqq8MIgb0+r3UTosTRtH72b9B3t7Pdctfm+44bm3w9+KKcvC X-Received: by 2002:aa7:da81:: with SMTP id q1mr25194862eds.25.1643728036155; Tue, 01 Feb 2022 07:07:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643728036; cv=none; d=google.com; s=arc-20160816; b=ohA8ShigCpG+MB0VEL8KFXKCTgwsmI6vIdVo++xxhRadS6kQx1u72P15YW8+a/hd3y aU2La4RVy7vNXrV829H0Hy+pBWk7+vqApY1W6HqVfSkW3MKeMJpwma3xIW2zuQu8KGDM lMnQAXGmpUW4RMaU8REAKDePNLAWzEe6rfP/dE39VRMWWytuZJ96UZIPZAjzdDKnsUMi e/VyfkDo5R9xd8ASbghLQtw/bnGll4BixjdWpHeYZxMj2jAPulPlFHrjgm7MstMkbXq2 ZHC0WQz+ADqd7vMrhGZyK5nhqeSWxc46YScAptUsXz7vLU7SxUmfAYSmFEtoihwbGyTI V2Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=V4njHS/l+xCpUU6oJvmynOFwMBGuHnqEE6FG5/Vy8lc=; b=GtRBnAjcrLaU0ji3vqO6oZ1Gl200q7KTRW/jFIHh0xqsTwPjF683D2/m0MqmZPnfZE b8LgrQbLtDN/yPxSH3bhQyX9YGXuQTZuluMdS57+TqLu20uUaLFtAssQSQdrEoARUYY4 YCSQbquaUwp43IAXenFsheCeuOlVbtrfnFfAhkLiFSVlDllfBZntLiGyR/XtCYs6gdRv 9SfYDDmGL9iRzpsS+hGzyqB14PEK30gdtAzjLc/J26GsDNk4XxivEkn8ctPHgv5Qs8em 14TYskfNpsfcrJddKDDzTJ+9sZCFPEetfup9MGmCYIPUNmDWMPE4YB33MdapmFLogYXA cvlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OFkF1qqk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ji7si9374396ejc.39.2022.02.01.07.06.49; Tue, 01 Feb 2022 07:07:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OFkF1qqk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356250AbiA3UrL (ORCPT + 99 others); Sun, 30 Jan 2022 15:47:11 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:31961 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356253AbiA3UrI (ORCPT ); Sun, 30 Jan 2022 15:47:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643575627; 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: in-reply-to:in-reply-to:references:references; bh=V4njHS/l+xCpUU6oJvmynOFwMBGuHnqEE6FG5/Vy8lc=; b=OFkF1qqkf7SjBYJMjdxJh9dmqLyyfM3thuhPjq0LCFw1XVumPMIiMSC2rIMer9CLVSpDjb Ub6fb90HTCOI+M+KhSMqj3Q8bYAjSLt4FKvr/5Hy86TCfoHg/wcqPcQ3pYRQUKym/1XfpY 9s+ibXwfIrOTYRSrXZZGlRs5aK7SXTE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-586-4cuJuRSZP92RlBmrS6_f5w-1; Sun, 30 Jan 2022 15:47:03 -0500 X-MC-Unique: 4cuJuRSZP92RlBmrS6_f5w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7783A814245; Sun, 30 Jan 2022 20:47:01 +0000 (UTC) Received: from shalem.redhat.com (unknown [10.39.192.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9971061093; Sun, 30 Jan 2022 20:46:55 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" , Mika Westerberg , Mark Gross , Andy Shevchenko , Wolfram Sang , Lee Jones , Sebastian Reichel , MyungJoo Ham , Chanwoo Choi , Ard Biesheuvel Cc: Hans de Goede , Len Brown , linux-acpi@vger.kernel.org, Yauhen Kharuzhy , Tsuchiya Yuto , Fabio Aiuto , platform-driver-x86@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, Andy Shevchenko Subject: [PATCH v4 08/20] power: supply: bq25890: Drop dev->platform_data == NULL check Date: Sun, 30 Jan 2022 21:45:45 +0100 Message-Id: <20220130204557.15662-9-hdegoede@redhat.com> In-Reply-To: <20220130204557.15662-1-hdegoede@redhat.com> References: <20220130204557.15662-1-hdegoede@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Drop the "if (!dev->platform_data)" check, this seems to be an attempt for allowing loading the driver on devices without devicetree stemming from the initial commit of the driver (with the presumed intention being the "return -ENODEV" else branch getting replaced with something else). With the new "linux,skip-init" and "linux,read-back-settings" properties the driver can actually supports devices without devicetree and this check no longer makes sense. While at it, also switch to dev_err_probe(), which is already used in various other places in the driver. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- drivers/power/supply/bq25890_charger.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c index d185299db9c3..548d1a793e31 100644 --- a/drivers/power/supply/bq25890_charger.c +++ b/drivers/power/supply/bq25890_charger.c @@ -1048,16 +1048,9 @@ static int bq25890_probe(struct i2c_client *client, return ret; } - if (!dev->platform_data) { - ret = bq25890_fw_probe(bq); - if (ret < 0) { - dev_err(dev, "Cannot read device properties: %d\n", - ret); - return ret; - } - } else { - return -ENODEV; - } + ret = bq25890_fw_probe(bq); + if (ret < 0) + return dev_err_probe(dev, ret, "reading device properties\n"); ret = bq25890_hw_init(bq); if (ret < 0) { -- 2.33.1