Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4828605ybl; Wed, 22 Jan 2020 05:30:30 -0800 (PST) X-Google-Smtp-Source: APXvYqwxsSkvwv8b9zStur9QGeEKC4Uc2gnyGCpO3MWD+K/p2Zbk/146jzCaiBsnAa+xSZJXA6Un X-Received: by 2002:aca:f1c2:: with SMTP id p185mr6997166oih.87.1579699830646; Wed, 22 Jan 2020 05:30:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699830; cv=none; d=google.com; s=arc-20160816; b=JcFqfYTBeZzRTX8x5+Kc1dqiHa7mRwWyBouG/aW8kt7Dyjgcn2qkzWR1krpK09+wpe 5LRhjePLACw8DJzCmwHUx7rA8K4O12GdtDrrvdoXf+ozHu9hOdv6NZyNtj/1JdvTLspU VCSvdeUkRHMLCcxSPDtjqBLAHkz49E6CSh3SHS8WeqFgweBppi/6IrPcVZ0VRhZ7U1on rrR6/42VMsPijCN5BR5rjDJc852h7dggmmazPTeUqxEScuOtw45sLPHePjjQOHnjynS0 7oFUu2D+/n/qRKO1uawACKKd78hMDvL7l7HuyyWKKG4t/knnjQMdzRan+6Il4qRPanHs QXqA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bTVscHTMce21aJo+OMbo9wxfujYXx6n6LeRmWowqrF8=; b=sFsTZb2UR0nb6I4r7SvqC0Y99jAzLzp+tvWzCJ/31fFLHccSIWE8OGzmsSe88rw1Xh 8Gu0jtGyAdwqGRYG8LMbWCmcpOg+t58D1+hEIqunw5eLbvhoYNw8z3R6Uz5/QVfJmtMB rvZR1qmlTS405XXagSvL6t7WiKSHbGqNbDboIoaUVRIGhn/O9DfoG3ySI01hqPGAsRmc hICV2I5C173Omf7V9PncyLpiIDDfMwUtXnAAdlJsbwSGlggubSQLOfqJFvthhXEHP2MY jEd78DC8m4kTr3avHRJk2AtS55oEXed/V0qXnpfHIiWQfjZhQUBzSMh4j7/rcmFe/XSS En1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hyVxTOQ3; 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 q7si15234335oti.268.2020.01.22.05.30.17; Wed, 22 Jan 2020 05:30:30 -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; dkim=pass header.i=@kernel.org header.s=default header.b=hyVxTOQ3; 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 S1732223AbgAVN2T (ORCPT + 99 others); Wed, 22 Jan 2020 08:28:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:50452 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730266AbgAVN2S (ORCPT ); Wed, 22 Jan 2020 08:28:18 -0500 Received: from localhost (unknown [84.241.205.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D48512071E; Wed, 22 Jan 2020 13:28:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699697; bh=ja63mQTeTWmf6LIxLrZKkAvOkCsQUOyH+pMv6e6ZBNk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hyVxTOQ3CKJL5U4BLWdFOoleYWKvii4bHUSLrAdksUvZLRSOd5DOEIUr2N0y5mhAm QNompD6di7xzMwyrK25Gq+Zod9xQf6sF6hqJlvhsxpLdvVnX5BJSgH0l6tRU/2hO3E m/p0w9zALNUc2o/iEpBDRXXnnSeGjgHK4wTM8SIM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eddie James , Guenter Roeck Subject: [PATCH 5.4 221/222] hwmon: (pmbus/ibm-cffps) Switch LEDs to blocking brightness call Date: Wed, 22 Jan 2020 10:30:07 +0100 Message-Id: <20200122092849.507081748@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eddie James commit 9861ff954c7e83e2f738ce16fbe15f8a1e121771 upstream. Since i2c_smbus functions can sleep, the brightness setting function for this driver must be the blocking version to avoid scheduling while atomic. Signed-off-by: Eddie James Link: https://lore.kernel.org/r/20191106200106.29519-2-eajames@linux.ibm.com Fixes: ef9e1cdf419a3 ("hwmon: (pmbus/cffps) Add led class device for power supply fault led") Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- drivers/hwmon/pmbus/ibm-cffps.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) --- a/drivers/hwmon/pmbus/ibm-cffps.c +++ b/drivers/hwmon/pmbus/ibm-cffps.c @@ -292,8 +292,8 @@ static int ibm_cffps_read_word_data(stru return rc; } -static void ibm_cffps_led_brightness_set(struct led_classdev *led_cdev, - enum led_brightness brightness) +static int ibm_cffps_led_brightness_set(struct led_classdev *led_cdev, + enum led_brightness brightness) { int rc; struct ibm_cffps *psu = container_of(led_cdev, struct ibm_cffps, led); @@ -311,9 +311,11 @@ static void ibm_cffps_led_brightness_set rc = i2c_smbus_write_byte_data(psu->client, CFFPS_SYS_CONFIG_CMD, psu->led_state); if (rc < 0) - return; + return rc; led_cdev->brightness = brightness; + + return 0; } static int ibm_cffps_led_blink_set(struct led_classdev *led_cdev, @@ -351,7 +353,7 @@ static void ibm_cffps_create_led_class(s client->addr); psu->led.name = psu->led_name; psu->led.max_brightness = LED_FULL; - psu->led.brightness_set = ibm_cffps_led_brightness_set; + psu->led.brightness_set_blocking = ibm_cffps_led_brightness_set; psu->led.blink_set = ibm_cffps_led_blink_set; rc = devm_led_classdev_register(dev, &psu->led);