Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp367691lqt; Thu, 6 Jun 2024 06:13:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV8ryQec4IOB7DRJ+QkF/JgSvDSsP8//dMqPFUoe/L3YVd0f+iHL8r8AkkEPnJ0L+8vY2vwxQqtrBwSfa1VwtA6Qg9bWe8nJ+HzURaQFw== X-Google-Smtp-Source: AGHT+IER+9XT1HJVZS71ELAjW0N/E+SZ7iOD09veI+58pEuy7IkQM2lxdWOE/rKoTgcetyA++L8F X-Received: by 2002:a05:6e02:1fcd:b0:374:a021:f18f with SMTP id e9e14a558f8ab-374b1ef308fmr55550175ab.14.1717679624100; Thu, 06 Jun 2024 06:13:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717679624; cv=pass; d=google.com; s=arc-20160816; b=Fbjmd2L1AqpJBM+X6LUU4Kyg5R9hBGoa6iiPj9f/UqzFPvNRPSsqfo5TW+ZGmwk/GR ZFqSXJt9nqLZ0LuarTP6ZhdGtHgUSbf3jBE1NPdMHvMPekle9uhXZtjmeM+IOxjIICGC BanfyYrB/Z6GcJbyWBwb732D7fcZLYSBvc7Ps0EoZBir8psrIgLfzeBzJBgakp9VRIy0 ss5WVLlZH7U8GlXnGqAd9mKMv+7CpqZyYrmQeN7JVLssVhlgSElUfq/oAW95o3TQpnJt mqjOjccqe1l/0B5z/fafNwRf6IGa/DSEMgeFef8q0282AnVxUduskgO8u9Mq1PUyVFOK RhFA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=LLTo6IN//CUfT633Q+EgtwxBk4Zhgr8yvAaTHaRrJKc=; fh=l/8rzFIzRxYCZtg0QJQP12PAgitg0WUuKTfR7ZoupS4=; b=c4sO1vr+SW3VhMIjH3io+e2TjItWRrdCdbGYPZS8DcuKY1MK9mjogr+xekXEsoi+UP KkEE0lpM+s06TxScmBaYCgu+dS8hYlXynh0KJZ9KDnLLm2Zh7TTdGi7b2uBuXsPErhPE cs1/sVjYpxReZiMRRJstp7xyxofeVPXUOJKSnQo0RfWTVsitosT29SDDu/p+b+K5t/ih m5xuJZlIVRfjDwAwCb6ykAvUt5Lq6VSmcgCUxONL1nuqiUWMXLyvRXEO9YU7F+n2p14m z3mdJs2HZaibl/4iRpx0Qa1orPvdD8WCVUR6e1EHZalQlfoA70PsqRcEZ46KeiLM92+x klMw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fDx1Lh6r; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-204323-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204323-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de20831afasi1007887a12.134.2024.06.06.06.13.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 06:13:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204323-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fDx1Lh6r; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-204323-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204323-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 6F6B0B2493E for ; Thu, 6 Jun 2024 13:10:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9D336195F24; Thu, 6 Jun 2024 13:10:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="fDx1Lh6r" Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2713E153821 for ; Thu, 6 Jun 2024 13:10:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717679432; cv=none; b=Iq0Afzsl8tKSblzhrf9qYqXSWwkJupHi0IEnXgS+6yz0hdjbMKs/OA7vBgNHCt0h867k2cBOfWQ01RLKKyCCsl79uRGGHw0MpDAUgwEDm1PK0X/+llqSqFSlSX0x0KIEywkhTPD/178B8S/oKSb5ll9clglJtTeACzChQqvlOGw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717679432; c=relaxed/simple; bh=zT88eZfNNd+RiyI4o59iAJCPJIAf8oivhPTjWxX35MQ=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=nCmJLJbSAxoTTTvNJlRbfsAwHATq0xHFeNQfI9SAXkjiaWz+pOz1YNzAwlOCkSPc8wvgUX94haRdDRaxzqWRrUGB7utWxI5dgnzSQLmdZssS0fNLf8mTBQ0FHpBsYVlBRQntDuFTiSWkM0HN6+CV76+rpzQOkhOh+8u2kR3c9gA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=fDx1Lh6r; arc=none smtp.client-ip=209.85.218.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-a68fc86acfaso144701466b.1 for ; Thu, 06 Jun 2024 06:10:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717679428; x=1718284228; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=LLTo6IN//CUfT633Q+EgtwxBk4Zhgr8yvAaTHaRrJKc=; b=fDx1Lh6rX1LDP8w/JsHdvLHz6V6cyvu0Vc8B/sXq4YtcwW1DmqkH+afCojavFduOcZ W/iz5jps5OsEzdRzyqWum3X1ZH2mcBRUS8rhCi2WXEb3qhKOvY2hcu3JIXz0pEEJ8Wpa IFT3ASthAA3NgddTEw5N+hLmRycL/jwcPCoKTzD2JjR9HdXMEmBywKEV2WC2kNrMeMUJ kqCUS3sxhg0mG+dkjghTfr51mJdZuN8a5YmSxnqkyZnTSYfIy7Ybs6XQWmSmTQ3be1Dl Iz/l2+dm/W2xjGTI/gWFY9djaSSlciEJ2JGHp0rCK5mDJfJwAeqSoOPGOPePQKsx7330 yAKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717679428; x=1718284228; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LLTo6IN//CUfT633Q+EgtwxBk4Zhgr8yvAaTHaRrJKc=; b=xU0pRhVW31x1h2Ip1KKKQUaote7I0/Bx18eK7fHdXJuhAWD99LA8aYg/Gtt9JPkQDq fYWuOSV6R2hjruWKxh0pa8dk4ZtpLPU7GKBlFhfm7flHatS5v4eBLdvQbPNr6vQw0+Ce vvOHYJkOajSVh1v1h+GlKMzOzsBjMbCUJWFzVy4eIZfPB7LUIWcXOd/GHe6lJhQI/ROq JQfUOvm0bBPWn375hp83daVpsOLif+/Inb1MKD77UIMXRPWgbmaeOqx9FyxeGTCuWrUF Ajidvp7U++ZJb4J6J6P2oPzqCbr+8/2SgaJOskh7gAcm1zqaTSv+cSqvNGF8bq5rYVYi sPoA== X-Forwarded-Encrypted: i=1; AJvYcCXyXyMGLBehesHJbWZ6uNk5WwZOAtYnou4uBCfSoxcnp8Okd5IEScxo1E9KdIF+sZfpcWJ3/8ygU859MHYkVozBOizyTQdGp8Wh6wI4 X-Gm-Message-State: AOJu0YzXP494CaoSA0bbqUm43bhHOFqJu6DYf3jAd8uwJ2kw1ZjDu+YI sTrgmhJPviw8lFhCea5OvAY5oZSSFB/UVhgzQFhAiajJPfXbflWeOS6Tw78uP9k= X-Received: by 2002:a17:906:e218:b0:a68:a476:6957 with SMTP id a640c23a62f3a-a6c7650a2ffmr216652566b.24.1717679428406; Thu, 06 Jun 2024 06:10:28 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6c8070e82esm94963466b.161.2024.06.06.06.10.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 06:10:27 -0700 (PDT) Date: Thu, 6 Jun 2024 16:10:23 +0300 From: Dan Carpenter To: Patrick Gansterer Cc: Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] backlight: lm3509_bl: Fix NULL vs IS_ERR() check in register() function Message-ID: <187b5bc5-a010-46c2-8ead-980df9efae79@moroto.mountain> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding The devm_backlight_device_register() doesn't return NULL, it returns error pointers. Update the error checking to match. Fixes: b72755f5b577 ("backlight: Add new lm3509 backlight driver") Signed-off-by: Dan Carpenter --- drivers/video/backlight/lm3509_bl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/video/backlight/lm3509_bl.c b/drivers/video/backlight/lm3509_bl.c index ab57f79ffe23..c93cdedff5ad 100644 --- a/drivers/video/backlight/lm3509_bl.c +++ b/drivers/video/backlight/lm3509_bl.c @@ -114,9 +114,10 @@ lm3509_backlight_register(struct device *dev, const char *name_suffix, } bd = devm_backlight_device_register(dev, label, dev, data, ops, &props); - if (bd) - backlight_update_status(bd); + if (IS_ERR(bd)) + return bd; + backlight_update_status(bd); return bd; } -- 2.43.0