From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:48417 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752265AbcJZIQ5 (ORCPT ); Wed, 26 Oct 2016 04:16:57 -0400 Subject: Patch "[media] cx231xx: can't proceed if I2C bus register fails" has been added to the 4.8-stable tree To: mchehab@s-opensource.com, gregkh@linuxfoundation.org Cc: , From: Date: Wed, 26 Oct 2016 10:16:13 +0200 Message-ID: <147746977337120@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled [media] cx231xx: can't proceed if I2C bus register fails to the 4.8-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: cx231xx-can-t-proceed-if-i2c-bus-register-fails.patch and it can be found in the queue-4.8 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 461af077d349b11106ca084e9ef2973a753d33ff Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 5 Sep 2016 05:56:37 -0300 Subject: [media] cx231xx: can't proceed if I2C bus register fails From: Mauro Carvalho Chehab commit 461af077d349b11106ca084e9ef2973a753d33ff upstream. The driver should not ignore errors while registering the I2C bus, as this device can't even minimally work without the buses, as it uses those buses internally to talk with the several IP blocks inside the chip. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/usb/cx231xx/cx231xx-core.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) --- a/drivers/media/usb/cx231xx/cx231xx-core.c +++ b/drivers/media/usb/cx231xx/cx231xx-core.c @@ -1302,15 +1302,29 @@ int cx231xx_dev_init(struct cx231xx *dev dev->i2c_bus[2].i2c_reserve = 0; /* register I2C buses */ - cx231xx_i2c_register(&dev->i2c_bus[0]); - cx231xx_i2c_register(&dev->i2c_bus[1]); - cx231xx_i2c_register(&dev->i2c_bus[2]); + errCode = cx231xx_i2c_register(&dev->i2c_bus[0]); + if (errCode < 0) + return errCode; + errCode = cx231xx_i2c_register(&dev->i2c_bus[1]); + if (errCode < 0) + return errCode; + errCode = cx231xx_i2c_register(&dev->i2c_bus[2]); + if (errCode < 0) + return errCode; errCode = cx231xx_i2c_mux_create(dev); + if (errCode < 0) { + dev_err(dev->dev, + "%s: Failed to create I2C mux\n", __func__); + return errCode; + } + errCode = cx231xx_i2c_mux_register(dev, 0); + if (errCode < 0) + return errCode; + + errCode = cx231xx_i2c_mux_register(dev, 1); if (errCode < 0) return errCode; - cx231xx_i2c_mux_register(dev, 0); - cx231xx_i2c_mux_register(dev, 1); /* scan the real bus segments in the order of physical port numbers */ cx231xx_do_i2c_scan(dev, I2C_0); Patches currently in stable-queue which might be from mchehab@s-opensource.com are queue-4.8/cx231xx-don-t-return-error-on-success.patch queue-4.8/mb86a20s-fix-demod-settings.patch queue-4.8/cx231xx-can-t-proceed-if-i2c-bus-register-fails.patch queue-4.8/cx231xx-fix-gpios-for-pixelview-sbtvd-hybrid.patch queue-4.8/mb86a20s-fix-the-locking-logic.patch