From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65E58C47247 for ; Mon, 4 May 2020 22:52:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3DA0E206C0 for ; Mon, 4 May 2020 22:52:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588632760; bh=oDW2m6L9Wrq4l6Sa6FvG+TJuH2YvKGkX1auEkVIa68g=; h=Date:From:To:Cc:Subject:In-Reply-To:List-ID:From; b=P5PPHLn9QHZkVJKpNDwh58Oqysz8D2l8oFmpFaddD35lThglltm0jPeVsKGB3TPWl zLphGepUdJP4i8ZWA0uxVrmNgQRKVTu0e062psGQwmDtinRxnp5DD57jZpncS37W9f h0jZW4OeZP1pK5zI/fxdvewpH+UUQX5DAVrC9jL4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728092AbgEDWwh (ORCPT ); Mon, 4 May 2020 18:52:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:43818 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726773AbgEDWwh (ORCPT ); Mon, 4 May 2020 18:52:37 -0400 Received: from localhost (mobile-166-175-184-168.mycingular.net [166.175.184.168]) (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 65AC3206C0; Mon, 4 May 2020 22:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588632756; bh=oDW2m6L9Wrq4l6Sa6FvG+TJuH2YvKGkX1auEkVIa68g=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=qmCv3L7FRPXdzRbioI3T3Quf3DdF6rhAzTR9i6zP7T4//X93+af4luIhonhjHQsxn O95sd19nj4u3WoDX9BhU/vRHt6Zi37Lp/sCZ6sACPd6FOUe2HAPUO8R8uVm7pVR6n6 raEzi3KqsL9DDVFz4SAVWJmSttzT9aOGcEGIbSDc= Date: Mon, 4 May 2020 17:52:34 -0500 From: Bjorn Helgaas To: Nicolas Saenz Julienne Cc: Stefan Wahren , linux-usb@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, tim.gover@raspberrypi.org, linux-pci@vger.kernel.org, f.fainelli@gmail.com, Greg KH , linux-kernel@vger.kernel.org, RayJui , ScottBranden , bcm-kernel-feedback-list@broadcom.com Subject: Re: [PATCH v7 2/4] firmware: raspberrypi: Introduce vl805 init routine Message-ID: <20200504225234.GA300024@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Mon, May 04, 2020 at 10:59:29AM +0200, Nicolas Saenz Julienne wrote: > On Sat, 2020-05-02 at 11:05 +0200, Stefan Wahren wrote: > > > + pci_read_config_dword(pdev, VL805_PCI_CONFIG_VERSION_OFFSET, &version); > > pci_read_config_dword() can fail, we might want to store the return value? > > I planned on doing that, but realised that the vast majority of > pci_read_config_*() users pass on checking for errors. > > Bjorn, any rule of thumb on when to check for errors here? Not really. It *can* fail, for sure. If it does fail, you normally get ~0 data, which means you would skip the firmware load, do another config read (which probably also returns ~0) and print firmware version ffffffff, and the device probably won't work. But checking doesn't get you much other than a better error message. Personally I probably wouldn't bother because it clutters the code so much for so little benefit. Bjorn