From patchwork Sun Jul 7 20:59:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 11034335 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 40A561510 for ; Sun, 7 Jul 2019 21:09:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1811928066 for ; Sun, 7 Jul 2019 21:09:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E525F28179; Sun, 7 Jul 2019 21:09:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6270C28066 for ; Sun, 7 Jul 2019 21:09:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727495AbfGGVJ0 (ORCPT ); Sun, 7 Jul 2019 17:09:26 -0400 Received: from antares.kleine-koenig.org ([94.130.110.236]:38738 "EHLO antares.kleine-koenig.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727385AbfGGVJ0 (ORCPT ); Sun, 7 Jul 2019 17:09:26 -0400 Received: by antares.kleine-koenig.org (Postfix, from userid 1000) id A5A16713FA8; Sun, 7 Jul 2019 22:59:36 +0200 (CEST) From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Antti Palosaari , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Subject: [PATCH] [media] af9035: issue an error message when i2c stuff fails Date: Sun, 7 Jul 2019 22:59:33 +0200 Message-Id: <20190707205933.23059-1-uwe@kleine-koenig.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of failing silent give a hint what went wrong. Signed-off-by: Uwe Kleine-König --- drivers/media/usb/dvb-usb-v2/af9035.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c index de52309eaaab..f5701fab192c 100644 --- a/drivers/media/usb/dvb-usb-v2/af9035.c +++ b/drivers/media/usb/dvb-usb-v2/af9035.c @@ -211,13 +211,19 @@ static int af9035_add_i2c_dev(struct dvb_usb_device *d, const char *type, /* register I2C device */ client = i2c_new_device(adapter, &board_info); - if (client == NULL || client->dev.driver == NULL) { + if (client == NULL) { + dev_err(&intf->dev, "failed to register i2c device\n"); + ret = -ENODEV; + goto err; + } else if (client->dev.driver == NULL) { + dev_err(&intf->dev, "no driver for i2c device (type=%s)\n", type); ret = -ENODEV; goto err; } /* increase I2C driver usage count */ if (!try_module_get(client->dev.driver->owner)) { + dev_err(&intf->dev, "failed to get module for i2c driver\n"); i2c_unregister_device(client); ret = -ENODEV; goto err;