Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp4481924rwo; Tue, 25 Jul 2023 06:49:42 -0700 (PDT) X-Google-Smtp-Source: APBJJlGpZg2PoCFsGkrP8Ivv+N1qWMrcofdUvt6tDoYcg71uz0xFoeryCqBXx99SvKqo7OWNrA4P X-Received: by 2002:a05:6402:2da:b0:51d:a488:3b3d with SMTP id b26-20020a05640202da00b0051da4883b3dmr9752657edx.35.1690292982240; Tue, 25 Jul 2023 06:49:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690292982; cv=none; d=google.com; s=arc-20160816; b=SjPwVx2ABo6SsSlSqTrb3epqSBxhyYAFP0mnhB/GZ/p+sCGRD2ePDuyEOPvnRU88+F upaKJw/8wsGxz5Gc0145+WHp4w6FpLISj8Ou4n+I9uLkgeC6014S5ST7dl3jhze0kwm/ 2fYajNghUHQZx/xtP5N1rHoVrYVd+MqI1Dg16LZPRJ42KbJn+dmJ9jV3bFFyXDIi75u+ YnoXoB2DRUAr5yukVIpS62yxVUheyEVBqnwIdkjmsxFrHnuaSl0d5AyTWI3/OQRov5+c ejHLCEWTNPmVm+F6aN/j/UZ/CLMv4D4JqQhrIViVclKkz0mFS0mbNcyM96XEaDdJxKvw cxCw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=3Puz3ztq+s5PMQIYSFqmtMplo+slwUgkmSW9O9rbzaQ=; fh=Sy2DcC8iBcoj93plRSksEF0esK794/0rw7KBx0/+VmQ=; b=Un19nv7WyCYjgjn2GcNMUdIMxn5TPxcdcFBMfsg4EX5nDWW7GRlHO0fdjtFNCbFXl/ nR7uuclhMoK0sWPzofROQapZQ0h2E3XrXD1KofLnm9r927c9bEgPoqstBTuuRuTTFE/j /Anehz9Bo7egjWZTbvT9yC53SoDCnJ4/VPC2od0crPMdnhfr+fV2U4ga9WCHVpovTzH3 b+glHz0SIZl2dHA4n2Yo4SYftuSGt5MmDZpEpKBhQmRe/TOqjUCTFJ1sbizPiThjdd89 saIg/kOLoSDEn78+W4a+JL3lE1BbjqWk790bPD0PiA062qpnmKm6RSmPaewsU+N5BgdM dPVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=eOX71mI8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=9elements.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y18-20020a056402135200b0051a48e2d185si7954086edw.286.2023.07.25.06.49.17; Tue, 25 Jul 2023 06:49:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=eOX71mI8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=9elements.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233545AbjGYMyo (ORCPT + 99 others); Tue, 25 Jul 2023 08:54:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232625AbjGYMyi (ORCPT ); Tue, 25 Jul 2023 08:54:38 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7C9D19AA for ; Tue, 25 Jul 2023 05:54:33 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4fb7dc16ff0so8296552e87.2 for ; Tue, 25 Jul 2023 05:54:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; t=1690289672; x=1690894472; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=3Puz3ztq+s5PMQIYSFqmtMplo+slwUgkmSW9O9rbzaQ=; b=eOX71mI8ivbPxd47f1eV4r7XwztgvsB/VUt6UiU2TRTzqzn/nnNc5dYBCQ7YDwpwcw 4HBgy5/tA3pr37dG8a8OX60bkNrHIpBqrsLUJw4zccm3bqKV2Lw5vm4RGbwODH7N6Her yiQtddh86DliiC3qSQhIR9Y1vNaY5Gt5CLb1vHwHV9UgJ9kjuPH05HuPeM57qIhIGKAq zs6T3wIBWTz3h8E8FwJ6FFDuoTE9KEJ0yZQQZFzZBrKjF656WagqNBNREbD7l8OcgZj0 jibS2zS5edmrdiyj3AmKMHjH7JmAAn9J894UFTXdqgXFhPnzh3Fk9sKgZqOyodCVziQL W9jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690289672; x=1690894472; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3Puz3ztq+s5PMQIYSFqmtMplo+slwUgkmSW9O9rbzaQ=; b=fNNvHWtKrGCoVCJnf3/B5im8KVoT+j5aEKMj6xDVd4oLFgc5s//ZQv76+31AVMQsrf KmNkEPPmkrqRgEcHKBo7yq8oVexpGck65gaYRPxNxTHsMJFuWoo2ZC/h8q0C8YimeztE wQ9dkLM+eXunlNg1NNlrhOv2YlEQ6vpYXQ6u3kiZARipaiiWweX72SPuJ+Ctbkbn0WNJ yhHyhoC9MF1IkdkWXqXk0l+T5/DB8z+QU7kOp3FcXA0MC3TaraZlaJiN4EJm9ENm+5DD NujfKH8+WQXyZNX28ZCXIXU/mheZRLumVKIHd4tGztYMuorgL2kGDNhh4Vs+EoDXwsDH khNA== X-Gm-Message-State: ABy/qLYPaiofDN2lVJCxGp9mZDAbeAdiQegfZlSqK+c7zJK0YJE/WhGd dQ88nGwismJ02wS24AbaX36hnA== X-Received: by 2002:ac2:4d96:0:b0:4fb:7532:35aa with SMTP id g22-20020ac24d96000000b004fb753235aamr7085307lfe.28.1690289671914; Tue, 25 Jul 2023 05:54:31 -0700 (PDT) Received: from stroh80.sec.9e.network (ip-078-094-000-051.um19.pools.vodafone-ip.de. [78.94.0.51]) by smtp.gmail.com with ESMTPSA id u11-20020a056402064b00b0051dfa2e30b2sm7516682edx.9.2023.07.25.05.54.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jul 2023 05:54:31 -0700 (PDT) From: Naresh Solanki X-Google-Original-From: Naresh Solanki To: Guenter Roeck , linux-hwmon@vger.kernel.org, Jean Delvare Cc: Patrick Rudolph , Naresh Solanki , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] pmbus_core: Refactor pmbus_is_enabled function Date: Tue, 25 Jul 2023 14:54:25 +0200 Message-ID: <20230725125428.3966803-1-Naresh.Solanki@9elements.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Patrick Rudolph Refactor the pmbus_is_enabled() function to return the raw status without any additional processing as its already done in _pmbus_is_enabled function. Signed-off-by: Patrick Rudolph Signed-off-by: Naresh Solanki --- drivers/hwmon/pmbus/pmbus_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c index fa06325f5a7c..42fb7286805b 100644 --- a/drivers/hwmon/pmbus/pmbus_core.c +++ b/drivers/hwmon/pmbus/pmbus_core.c @@ -2768,7 +2768,7 @@ static int __maybe_unused pmbus_is_enabled(struct device *dev, u8 page) ret = _pmbus_is_enabled(dev, page); mutex_unlock(&data->update_lock); - return !!(ret & PB_OPERATION_CONTROL_ON); + return ret; } #define to_dev_attr(_dev_attr) \ base-commit: 55612007f16b5d7b1fb83a7b0f5bb686829db7c7 -- 2.41.0