Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1159990imu; Thu, 20 Dec 2018 11:09:32 -0800 (PST) X-Google-Smtp-Source: AFSGD/W8+VEvuSmdooarWPQwkYpuKu5ypMbiNG9W3pdjtyCquiCggh4kzXuc6YWba+WihQ5pzSct X-Received: by 2002:a17:902:7c82:: with SMTP id y2mr24866056pll.33.1545332971949; Thu, 20 Dec 2018 11:09:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545332971; cv=none; d=google.com; s=arc-20160816; b=eJq7ND5NA0XND3GcPlFhWaz1AdkwMXIXMhC/EoJZHnB6aHajOekO4/v5AmpU7H555E NJbmRgA54UaBJQ/iiVg0GYI1bygstaR/mutqYiQ0l37gmuFKd/a0/E3WE8+8V2xsUzKp MR4eQtiVRuuP7mLdz900xIz9Ge2MAmhpSf1SVAi+Ces9hXRGRrtHa/zE9cYZgrlXv7QG tNO3achKuzKk8BM5PoNDcK8L9/Kq5xdPYO/gaGvvuUguUaMIQFvsGa4Mg6dWAB7xg9MQ aNaXFEnGP1eibiG5AEfiwNwt5u32Bp+gk7+rCek9RSLrC3xxyayfiwsOPjmKyTefKU6Z JqQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=CBPDEPRhCP+eGDy87/DSZ8I0za3vfuRv7qu8KqplgR8=; b=y4DMtT7C8L8uptmHT6kSqQHOqATQ0sGCpVZ3OrkEztef1UGegt5frr4f7W1Nf5IZ1p SQ937qF62vaRA7bgCQ8jzhusSTMf0y6zm1cgEA1TMwepKd3dTOxMUA87s6T5yvbRNiqS lCOWt37VBqe+HJmIUsiMO9XXI9XPl9gx4wTfQZ8imP/otvhOH4Qz39hnJpROO/LA8FcZ zhUg2Jx0i9f79vfQd32+PslW7tGeK2C8oXrb+QyTvMLr45cTXK2jlLqAOF9CUctbzEGI wCoPYQ7KNgaE0B2YNp8t+BzWZgmA+foUHzWe/I4fEi6Izm01stNgxoaXcHtrNvlnheLs JiMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=qbfQtYy0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e89si15917621plb.401.2018.12.20.11.09.15; Thu, 20 Dec 2018 11:09:31 -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=@samsung.com header.s=mail20170921 header.b=qbfQtYy0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730869AbeLTKXI (ORCPT + 99 others); Thu, 20 Dec 2018 05:23:08 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:44105 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725355AbeLTKXD (ORCPT ); Thu, 20 Dec 2018 05:23:03 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20181220102301euoutp02946de47b5a5910b4504eeb5369660c25~yA2tHY7wr2917329173euoutp02Q; Thu, 20 Dec 2018 10:23:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181220102301euoutp02946de47b5a5910b4504eeb5369660c25~yA2tHY7wr2917329173euoutp02Q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1545301381; bh=CBPDEPRhCP+eGDy87/DSZ8I0za3vfuRv7qu8KqplgR8=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=qbfQtYy0HYqJlG3+IoKG69DlmOZ7axWTW9X4f9ET2XXOMVEikElh4VB0kWmXXQYpi iA3qqjg2/Mgwqt6PSbYYEPB2a7jDNSNBu69ttEztC3RP/agFjck/F59Fl93dasHyro KxWByT8tMhjE7GPq7RYARxHBC6xiaK+yaGVRDtCw= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181220102300eucas1p1da6fd45b5f00a847189cd3aa25ac8528~yA2sqlKFc1464414644eucas1p1S; Thu, 20 Dec 2018 10:23:00 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 3C.A2.04294.48D6B1C5; Thu, 20 Dec 2018 10:23:00 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181220102300eucas1p210735c7753688a52a73ccf026884dd11~yA2r_0frK0421304213eucas1p2E; Thu, 20 Dec 2018 10:23:00 +0000 (GMT) X-AuditID: cbfec7f4-84fff700000010c6-7c-5c1b6d842770 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 24.49.04284.48D6B1C5; Thu, 20 Dec 2018 10:23:00 +0000 (GMT) Received: from AMDC3748.DIGITAL.local ([106.120.43.17]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PK100480669SP10@eusync3.samsung.com>; Thu, 20 Dec 2018 10:23:00 +0000 (GMT) From: Andrzej Hajda To: Greg Kroah-Hartman Cc: Andrzej Hajda , 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: [PATCH v4 3/3] driver core: add probe_err_ptr helper Date: Thu, 20 Dec 2018 11:22:47 +0100 Message-id: <20181220102247.4911-4-a.hajda@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20181220102247.4911-1-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFIsWRmVeSWpSXmKPExsWy7djPc7otudIxBmevaFjcWneO1eLlhMOM FhtnrGe1mPrwCZtF8+L1bBYLpy1ntNj0+BqrxeVdc9gsDk3dy2ix9shddou5X6YyO3B7XL52 kdlj56y77B6bVnWyeeyfu4bdY/OSeo/3+66yefRtWcXo8XmTXABHFJdNSmpOZllqkb5dAlfG o2NiBZfYKno3fmFqYDzC2sXIySEhYCJx7NZrIJuLQ0hgBaPEusWP2CGcz4wSXxduYoepun12 AVRiGaPE/NbvLBDOfyDn1SKwWWwCmhJ/N99kA7FFBIwl+s/OAutgFpjHLPHy1R0mkISwgK3E u4kPwIpYBFQljjX8YgSxeQXMJbrmPWKBWCcvsXrDAeYuRg4OTgELiZ8rweZICGxhk/j7cg0L SFxCwEVi4l5LiHJhiVfHt0BdKiPR2XGQCcKul2iaeYUZoreDUeLE4uVsEAlricPHL4IdzSzA JzFp23RmiJm8Eh1tQhAlHhI3Zq5jgniym1GiZfEe9gmMkgsYGVYxiqeWFuempxYb5aWW6xUn 5haX5qXrJefnbmIExvDpf8e/7GDc9SfpEKMAB6MSD++MKKkYIdbEsuLK3EOMEhzMSiK8j7Ok Y4R4UxIrq1KL8uOLSnNSiw8xSnOwKInzVjM8iBYSSE8sSc1OTS1ILYLJMnFwSjUwcjHfLHhj sPd2vDjvwzXnTgp7B7A4lWTltkebsiVNSTBZo3pf/XeJWnKH2iqu3VpPN8U8nOjiek7i+q+5 fze4aPyyY99WZbni0JOnwosnyHU9XpBxV+BxwLraxFVXuIoC1POWMnR9u5a826J7ovKGguRV hS57vyV9DrMQF/1/ZKXrnsWtPQHmSizFGYmGWsxFxYkAWcn2It0CAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOLMWRmVeSWpSXmKPExsVy+t/xq7otudIxBmePc1jcWneO1eLlhMOM FhtnrGe1mPrwCZtF8+L1bBYLpy1ntNj0+BqrxeVdc9gsDk3dy2ix9shddou5X6YyO3B7XL52 kdlj56y77B6bVnWyeeyfu4bdY/OSeo/3+66yefRtWcXo8XmTXABHFJdNSmpOZllqkb5dAlfG o2NiBZfYKno3fmFqYDzC2sXIySEhYCJx++wCdhBbSGAJo8S250A2F5DdyCRxcsI8sCI2AU2J v5tvsoHYIgLGEv1nZ4EVMQssYpbYu24fWJGwgK3Eu4kPwIpYBFQljjX8YgSxeQXMJbrmPWKB 2CYvsXrDAeYuRg4OTgELiZ8roRabS/y5M51tAiPPAkaGVYwiqaXFuem5xYZ6xYm5xaV56XrJ +bmbGIHBt+3Yz807GC9tDD7EKMDBqMTDOyNKKkaINbGsuDL3EKMEB7OSCO/jLOkYId6UxMqq 1KL8+KLSnNTiQ4zSHCxK4rznDSqjhATSE0tSs1NTC1KLYLJMHJxSDYxZvgwG2Te3fHpyNnyb 1cSFj8+kx96J2HZr1axJbCIaNb3PH086zSqqapdq8n+t2IbPRfJNRlv0rHhVOXXF+wtZtih+ vVYyJbplwbklouUe9osOdV0wf3M4lsetLcE9UOh0X8m8W/3vnwoei9WQ0FvyMWG+48K6fMO6 etuGKc1WyhsPq16Nuq7EUpyRaKjFXFScCAD12L3MOgIAAA== X-CMS-MailID: 20181220102300eucas1p210735c7753688a52a73ccf026884dd11 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181220102300eucas1p210735c7753688a52a73ccf026884dd11 References: <20181220102247.4911-1-a.hajda@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org probe_err is useful in multiple contexts where error is encoded in pointer. Adding helper performing conversion to error value should simplify code further. Signed-off-by: Andrzej Hajda --- include/linux/device.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/device.h b/include/linux/device.h index 2d3a1cc6f5da..50632414c363 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -1594,6 +1594,8 @@ do { \ extern __printf(3, 4) int probe_err(const struct device *dev, int err, const char *fmt, ...); +#define probe_err_ptr(dev, ptr, args...) probe_err(dev, PTR_ERR(ptr), args) + /* Create alias, so I can be autoloaded. */ #define MODULE_ALIAS_CHARDEV(major,minor) \ MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor)) -- 2.17.1