Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp139955pxa; Mon, 10 Aug 2020 21:43:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvh8n0g8n0cp2ToUJr8DQg15G6rDEy+QKl4ITfz8JqkL5tXj7ZeSSKNRfUUm9dZM53mRlz X-Received: by 2002:aa7:da0e:: with SMTP id r14mr24745243eds.236.1597121021958; Mon, 10 Aug 2020 21:43:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597121021; cv=none; d=google.com; s=arc-20160816; b=wR5o8iE15aq13Fykro0P69EEoFfSepGf4tx8T4e3WWxdjm4/eVYchZSm1PwmQavwJd Wv00ULGSQsTaEgCW5MwU66WGlvIWIFrWP/oKfoo/Qqa22+tFZzg/iDUGDG7STx8UZktY 5yJonwpMTWSq9+EJVEOqSL9OEss5g5Ag+ZHECI0XCFvo3fyuWHxX+eeBWQm26L1v3pae J+QxG25eqa12VQMIoGUP5ez219Ydhybi5CeJbwOCzfzHbF5lb4CjC1oiUeSihq9SDLoh HqU/cV6sbH3nOxzVGg1n0jAS6cqGKq/xPobnAONPcubljnfqtWA3L/1axXtthfmfwVnA 1AcQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=mE27Q38brRQJRQFHecs3wbVF5vyzIo0pA5YfBnjEd0M=; b=B0YQJ0ZN/jO1U4eD2Lcy/OsgNYhiyDBUW7AGaU0zXkl95QiVvrqlYQQRKpd+QzFiIL 7k1warL6pnxqO5+EPaSQZwWQyYAgAdRR2S4l2m0c7Pr+9Hhh0A91BzstFBpRjYU9Ablm tMmycqGdF9+VpsN9DagI4IrDufvfPXecjnMigaH5PSBlcNXuX2iKJ2imn3jbzj6vnYeF z2k1N6+4vvxkP4GUHVPmqTRqtcYmmnWLkBDH7lxKYx1tLZCH3mumNE+OoNMC8L8UEYRB /dM8rPVBlf/+FaFnzANpmM+1xM3QZqYq1XbY2Roty/5Xfay9Jm++ROh6frYaq2d4Np5K Z8+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dcwuxobT; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h23si13313720ejx.550.2020.08.10.21.43.18; Mon, 10 Aug 2020 21:43:41 -0700 (PDT) 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=@chromium.org header.s=google header.b=dcwuxobT; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726557AbgHKElq (ORCPT + 99 others); Tue, 11 Aug 2020 00:41:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726520AbgHKElq (ORCPT ); Tue, 11 Aug 2020 00:41:46 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC282C061756 for ; Mon, 10 Aug 2020 21:41:45 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id z20so6210695plo.6 for ; Mon, 10 Aug 2020 21:41:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mE27Q38brRQJRQFHecs3wbVF5vyzIo0pA5YfBnjEd0M=; b=dcwuxobTOVwsVWMExcu2c1u07wvKJPkUNKWxbz91PgELKLP2CMXHd9hz3m4ZbgJa5d GfEb1wxg9eB7K2iGnUeYoYysBiatdmXrfGk5jMCRb9mmSjHTWPXxzCwJ07UyVtdYbq1e 9t/o5JoiiJ2/YZbnx6q9FOg3jOGLyeyB0jsCo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mE27Q38brRQJRQFHecs3wbVF5vyzIo0pA5YfBnjEd0M=; b=HLPetaAOzevxgs/w/XKSm5YLKzqwvveRM9ui/sgziVafjX5h5DyNjMuydxRXgjetK5 6EZlKOSIkiuay5+S5nMoIguGeN2lGv/9HA0UN0HCRJrqmSl/ro9p+Tl/wGaeYjrbW3io lakbpUNP9IzeD6gFKZaRxBNmkZ0sCYPOFQPGvz4Q/begvVrI3CJWTgoBT4KGlZAOB/vJ 6EYe4ZvmoAUpp55aVx8rm46S40fVVkAc8xiYIV8Teb47QDbPgPfxje72qA6YE1K7jNWB C/+51mh7QddXX75B40n34+AQOQWurjQsGU4wBrHnX2ee9LQWenRbZCfJELNMMV4qKNWP YVVQ== X-Gm-Message-State: AOAM531Pcq9TA9EZ0nJZ5zarcMONpA7FvEDLlj963qXy2HQtKWU3JrGO Ls5zgk+B/XaTAuMBqbA1Ifsb5A== X-Received: by 2002:a17:90a:b386:: with SMTP id e6mr2826993pjr.57.1597120905375; Mon, 10 Aug 2020 21:41:45 -0700 (PDT) Received: from ikjn-p920.tpe.corp.google.com ([2401:fa00:1:10:f693:9fff:fef4:a8fc]) by smtp.gmail.com with ESMTPSA id l78sm445671pfd.130.2020.08.10.21.41.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Aug 2020 21:41:44 -0700 (PDT) From: Ikjoon Jang To: Sebastian Reichel , linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Ikjoon Jang Subject: [PATCH v2] power: supply: sbs-battery: remove unused enable_detection flags Date: Tue, 11 Aug 2020 12:41:41 +0800 Message-Id: <20200811044141.1821281-1-ikjn@chromium.org> X-Mailer: git-send-email 2.28.0.236.gb10cc79966-goog 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 Remove unused enable_detection flag which is always true after the device is proved. Signed-off-by: Ikjoon Jang --- v2: initialize work queue before registering power supply --- drivers/power/supply/sbs-battery.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/power/supply/sbs-battery.c b/drivers/power/supply/sbs-battery.c index 83b9924033bd..1b706adc8d43 100644 --- a/drivers/power/supply/sbs-battery.c +++ b/drivers/power/supply/sbs-battery.c @@ -185,7 +185,6 @@ struct sbs_info { struct power_supply *power_supply; bool is_present; struct gpio_desc *gpio_detect; - bool enable_detection; bool charger_broadcasts; int last_state; int poll_time; @@ -876,9 +875,6 @@ static int sbs_get_property(struct power_supply *psy, return -EINVAL; } - if (!chip->enable_detection) - goto done; - if (!chip->gpio_detect && chip->is_present != (ret >= 0)) { sbs_update_presence(chip, (ret >= 0)); @@ -1007,7 +1003,6 @@ static int sbs_probe(struct i2c_client *client) chip->flags = (u32)(uintptr_t)device_get_match_data(&client->dev); chip->client = client; - chip->enable_detection = false; psy_cfg.of_node = client->dev.of_node; psy_cfg.drv_data = chip; chip->last_state = POWER_SUPPLY_STATUS_UNKNOWN; @@ -1077,6 +1072,8 @@ static int sbs_probe(struct i2c_client *client) } } + INIT_DELAYED_WORK(&chip->work, sbs_delayed_work); + chip->power_supply = devm_power_supply_register(&client->dev, sbs_desc, &psy_cfg); if (IS_ERR(chip->power_supply)) { @@ -1089,10 +1086,6 @@ static int sbs_probe(struct i2c_client *client) dev_info(&client->dev, "%s: battery gas gauge device registered\n", client->name); - INIT_DELAYED_WORK(&chip->work, sbs_delayed_work); - - chip->enable_detection = true; - return 0; exit_psupply: -- 2.28.0.236.gb10cc79966-goog