From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 6EEA423ED5B for ; Thu, 5 Mar 2026 05:48:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772689708; cv=none; b=sqlDlCWm4a4acxKFGC7mmKJsJtG4TzjCypoGAASvqheoMrILqaszMEF0lLFKN36kE6DAnOa/zw+7Fohi229ohpSzgGRvVUcqUyNnp8jt5+B++kD+/qhNH5E5w1u6pvPEM9oKQDfeodYsXT3KZhpoDZY0j0AD9PXx6HUSjSAjlP0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772689708; c=relaxed/simple; bh=hbtHb7uyJF1aXgsD8bxT0M0kmGebDw4L50Af1vw2008=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gS/0lf/hERISA4Amx0tJs8NHF2ZLx3QPHDa3nhRtxjY2JTzEp6NAnWwA2xjXDSqoUNDl8/Qy24uS1Z38z8Antz+pTJvDQDb7MNG2jS5uwsYUlApzNkXQjPtD0TgI402CedfijVm4LOr1RJhKVmMNXTmxFZFh3uKHF9PRBTQpgVQ= 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=lOjuHKxy; arc=none smtp.client-ip=209.85.221.54 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="lOjuHKxy" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-439b97a8a8cso3892047f8f.1 for ; Wed, 04 Mar 2026 21:48:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1772689706; x=1773294506; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=tosFlEOKGj8XInQr/E0mYfY51v7I4YOwqCWi7kcZaGo=; b=lOjuHKxyZ0HCPI/c+EHvIWo+aKc+aegJODett1xzj/qpec/mFU93sR/qRBn7nDDH3y 9djg4rioUCYBq4Wd0hxWkJGZ+cjuP/rldEbfsDI/1yJRajfjFsf5HinUKDAX/qAwyLde krltGojm2EorWQJocuz0dRbWflj+NtJfJKkfC+SNNZZ0CY/njvOdJsbPKDjpGXzn1frF UwTHDGg9Bjo0wZ4tVNJvbNsYLY6+kAZk1Fl3BvvcaW3E+BSTGw4WLmTi1OH2ypR0p5Tc STVH/eeXGDW3bh9pfqS75f6+Ca5rqs1OtU7BZpRrGjPP1wom0Qyjn1aVG52ZYKCGBLgh CtCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772689706; x=1773294506; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tosFlEOKGj8XInQr/E0mYfY51v7I4YOwqCWi7kcZaGo=; b=QNr3X+5Bg/gdthPi4BtItjI8AhtPNUq+7Ia/eXwITyTuYHXiVDQErA97fzV1IOdakP GUL2CQqmqUlG+twBRhBw4r/i+vVTs/Liz1YfnK34TdGLzR0MHXt4N8znJeINJNOsXd6t VzqHVMRGGNcY+7uBqENy8wSDcwM9EafNk8HbJ8fQMPFhzjKrSBd/FJo1k8MlXBd580b7 PpSXDTKtPuOEkH8oTJPEnydEqS3Jm9BrfIhTOf3zuxI6twQxC4SjqWrPUJkNAanfT6R5 MpBmlQeR8Iup5VwucJ7SmRJUoL3QewmKfdS20LAndRAdiVqMeZbuv1/HQnbNi5tPu2ib no3Q== X-Forwarded-Encrypted: i=1; AJvYcCW8VQzvIY39Awypvb2XJF9VoD0DV/lJ9zymwMy6WjbSNbE4WKw2H6KAMVK6Nadnd8+5aoIWdvbxB81xSAk=@vger.kernel.org X-Gm-Message-State: AOJu0YwFyXGCj/5IaJIfkls3YdBExpk3J9uT1kjEm3qNBSCb/lUyiwfx xxjFC/wfzTvPlkOpTHV/gV6MkI42JeZzfAJKIF+ID4v6JwgCw48hr4n7fe5l0z/qM00= X-Gm-Gg: ATEYQzzPRWzsUJxvi39iK7zygRReBLvL91uwnC3iSEGTsyFuyGHkncmftwj1QqaU38w apTzHXqrhWF4Sfrphed+NWVOZLxY7/320PMwEnW2xELJDE8m54PVeR+poPrcRtL91un2lN07ewd 625QVtP6UHQVtNcYmVE3tnI8EXZZ18D8ASL2p7DSzaNGR62LIk3tCSLDAW5Mt+9d+tatDqdLto3 0KB2twALLB48dm8x3ENmpdUsbpk/UhCOx3ReMOOFrslCehmDqgOftQGMpc+LXJquPqPCDXg6RJi a2fsQ/yn4zXeW4JcTRrb7NEoWZzDSnK8av71rZ62zyAPqjHJtZh1PMiAq6vjvPbx1eR4d6ajaXV HWzjMNb44izS8tj4SqOzJjQKMnbqhaP1JoVkNRbWVPpg8PhDIw5d6GWrCi3g7yXL9OT+kwY2Bc+ Qz6UEPQkk9A8eQY5AsWW8p0DoGu78C X-Received: by 2002:a05:6000:228a:b0:439:c69f:503a with SMTP id ffacd0b85a97d-439c7fd38c0mr8472479f8f.27.1772689705601; Wed, 04 Mar 2026 21:48:25 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439b03db76bsm32639731f8f.18.2026.03.04.21.48.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2026 21:48:25 -0800 (PST) Date: Thu, 5 Mar 2026 08:48:22 +0300 From: Dan Carpenter To: Soham Kute Cc: sudipm.mukherjee@gmail.com, teddy.wang@siliconmotion.com, gregkh@linuxfoundation.org, linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/6] staging: sm750fb: sm750_sw_i2c_init: return -EINVAL for invalid GPIO Message-ID: References: <20260304173529.192067-1-officialsohamkute@gmail.com> <20260304173529.192067-6-officialsohamkute@gmail.com> 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 In-Reply-To: <20260304173529.192067-6-officialsohamkute@gmail.com> On Wed, Mar 04, 2026 at 11:05:29PM +0530, Soham Kute wrote: > Return -EINVAL instead of -1 when the GPIO pin number is out of > range. The caller ignores the return value. > > Signed-off-by: Soham Kute > --- > drivers/staging/sm750fb/ddk750_swi2c.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c b/drivers/staging/sm750fb/ddk750_swi2c.c > index c73943341f66..46599be8d6b9 100644 > --- a/drivers/staging/sm750fb/ddk750_swi2c.c > +++ b/drivers/staging/sm750fb/ddk750_swi2c.c > @@ -344,7 +344,7 @@ static unsigned char sw_i2c_read_byte(unsigned char ack) > * data_gpio - The GPIO pin to be used as i2c SDA > * > * Return Value: > - * -1 - Fail to initialize the i2c > + * -EINVAL - Fail to initialize the i2c > * 0 - Success > */ > static long sm750le_i2c_init(unsigned char clk_gpio, unsigned char data_gpio) This part needs to be done in the patch that changes sw_i2c_read_byte(). regards, dan carpenter > @@ -382,7 +382,7 @@ static long sm750le_i2c_init(unsigned char clk_gpio, unsigned char data_gpio) > * data_gpio - The GPIO pin to be used as i2c SDA > * > * Return Value: > - * -1 - Fail to initialize the i2c > + * -EINVAL - Fail to initialize the i2c > * 0 - Success > */ > long sm750_sw_i2c_init(unsigned char clk_gpio, unsigned char data_gpio) > @@ -394,7 +394,7 @@ long sm750_sw_i2c_init(unsigned char clk_gpio, unsigned char data_gpio) > * range is only from [0..63] > */ > if ((clk_gpio > 31) || (data_gpio > 31)) > - return -1; > + return -EINVAL; > > if (sm750_get_chip_type() == SM750LE) > return sm750le_i2c_init(clk_gpio, data_gpio); > -- > 2.34.1 >