Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp920352imu; Thu, 20 Dec 2018 07:22:51 -0800 (PST) X-Google-Smtp-Source: AFSGD/W98L7t1eXfRxxdGACDz6E/4kLkCBt9DrR1X6r2g7zjiuMzT9ABirPw61xRvzEaYLgNlPpQ X-Received: by 2002:a63:4c5:: with SMTP id 188mr7041081pge.391.1545319371422; Thu, 20 Dec 2018 07:22:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545319371; cv=none; d=google.com; s=arc-20160816; b=MJCoEQfnB2N9/7wFEjEdJH0JhJccgvfN+bjrExqoAxUhyRbODFSWlaIQkbTIh5byPW rnZ95VFg3ubCsAWhjWPKqWEcsyiCItO/V1xEyt88oquz8gh/KAWAc4rMGnO05984Gb9i o21fD4ibBgi7hZ/CkqaGJnGLO3E/6POoeIWt9Flojw6lK+Cd7jhejJh6fbq+ilA0zsTs rsyETn5W6txeSIhjCFhdQ2mH723x4YAXwHxODpwzfNr65p8fQRQu48MuXSNJpYFW1qdN lHxziRr99qZyE23DveQ488RgYumwRHJiCfimohzomMjynhBfk3ru1/Q5U7DJX2R96VH4 CSGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=H3D/j0uUqAt/6idOkxBCxA835qvDFl3Y9WY40Tqx7zs=; b=Rl58rwgii/FkB/n4dhZ7PBAGqq8ZWhePH0bO/U1JMpKU3yAx72s89//SZ8KShAgnRu 0cfr2LTrwgONyCPnJ8RujYhKuJBCtVpIdEdWIz+KnwMDVShhBGFyC6Zt25gQCOiAAR0e yoMG53rvUyAXD+OG7s19C1vrWZiZxL8KhZSdMByjIOqbtUkvVm0fNHrg8pKBKs8zrfvV Etj+ATJl0uPEIfCZimoXRLGYYgGWsv+Qya/Hx3G8c+kK1g2q0svi95vpTHyUFfiirCSE NROiIWlq/3c+uSWiFNmw6htv4H9bl7Lu5lCT8IXplysSztQgIY/J1dGfG+eNFkUhVWQb dqbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NB1MIHDt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y27si17198245pga.459.2018.12.20.07.22.33; Thu, 20 Dec 2018 07:22:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NB1MIHDt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731436AbeLTLOG (ORCPT + 99 others); Thu, 20 Dec 2018 06:14:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:58166 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728172AbeLTLOG (ORCPT ); Thu, 20 Dec 2018 06:14:06 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 31EE22177E; Thu, 20 Dec 2018 11:14:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545304445; bh=qkcBJQcK9EzKTNvCn2J3Q56O1CSgbtK7TIpoj0Cd1MQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NB1MIHDtKAO6S3NbbT/7Muqq1uORKJnYiv0l928izLYYVbo4Z7jlbMQFJRsrK7oG/ JGZ12MMEB5E1MM0HKOr6GU6sN2Z2J3j8LSVx9afVTFLLrSvHhK8hmZ7FN8cvM6P6+S JD6dkxejLlXwKRQbupoarJZxBbGNPPWYwIVv6JZw= Date: Thu, 20 Dec 2018 12:14:03 +0100 From: Greg Kroah-Hartman To: Andrzej Hajda Cc: Bartlomiej Zolnierkiewicz , Marek Szyprowski , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Javier Martinez Canillas , linux-arm-kernel@lists.infradead.org, andy.shevchenko@gmail.com, Mark Brown , Russell King - ARM Linux Subject: Re: [PATCH v4 1/3] driver core: add probe_err log helper Message-ID: <20181220111403.GB10978@kroah.com> References: <20181220102247.4911-1-a.hajda@samsung.com> <20181220102247.4911-2-a.hajda@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181220102247.4911-2-a.hajda@samsung.com> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 20, 2018 at 11:22:45AM +0100, Andrzej Hajda wrote: > During probe every time driver gets resource it should usually check for error > printk some message if it is not -EPROBE_DEFER and return the error. This > pattern is simple but requires adding few lines after any resource acquisition > code, as a result it is often omited or implemented only partially. > probe_err helps to replace such code sequences with simple call, so code: > if (err != -EPROBE_DEFER) > dev_err(dev, ...); > return err; > becomes: > return probe_err(dev, err, ...); Can you show a driver being converted to use this to show if it really will save a bunch of lines and make things simpler? Usually you are requesting lots of resources so you need to do more than just return, you need to clean stuff up first. thanks, greg k-h