From patchwork Sun Apr 24 21:08:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Dimitrov X-Patchwork-Id: 8921731 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9D0699F1C1 for ; Sun, 24 Apr 2016 21:11:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CD20C201EC for ; Sun, 24 Apr 2016 21:11:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E4A2E20219 for ; Sun, 24 Apr 2016 21:11:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753304AbcDXVK1 (ORCPT ); Sun, 24 Apr 2016 17:10:27 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:34151 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753258AbcDXVKT (ORCPT ); Sun, 24 Apr 2016 17:10:19 -0400 Received: by mail-wm0-f65.google.com with SMTP id n3so20027752wmn.1 for ; Sun, 24 Apr 2016 14:10:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DapRaW2xl8FkqkIdX7JpsZRXukZMdYAkKMjwxJf/kvs=; b=FPJZX0M+C8X6mwLkU3mLpotMoWwou2a+3B/+fP6sOyLjeQQbG+mMesXrvEzVPp0Y1y 3JmHB00lDGmfdlEXK4O/TeyjrGoKE2Nt/bchch9d+TXgeWffoNxdZ+uAQuQIlV0LqvCz Tl7Ep66uAp8oZBuDAPpgpp+tIHqxV7Z7f/2uqBKkwu8F8s4OSUfT08xfddCQp/vSo7di eBWuQMfC9Su6mMo4XEYrADaQeDDj/H5boglvhNypkMfd/NYlfUYj8Wemwh4JoVYsUfSx wXB+LUJnbASIrhumEamH4ZA/8szBn3RVGI1wQMXZB/murcznjOwImC5aDyyYR7zaZ4Et 6Bww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DapRaW2xl8FkqkIdX7JpsZRXukZMdYAkKMjwxJf/kvs=; b=Ar2/NXPLOn97xg2yGP8cYUiYf4JAK1iXvayAn1TsX7AhZF+wO8OMAzvPYAkEHSzcfE win1E/sTP5MP+dh/wnidg+wgsbye99/RGgwpIzth4hzelYZff3AdVVTGwUrhM8nAZsGQ lxadaL4KkPy0HQ9uZDJ0Oow71natcYLMM56WDcZsCMAaivh2C/5U9FRHdGgF9V/IZt5J e/1q6WXdrCPW3J0wNjw+JvcP4slYxwYAPVIJt4ERwtKvBfilR4YMkEL2Jhkia7sH4Q9P 9RsLf2YOyCPVy4kGO53Mzc9pb0yYCSvkWPpRoyBAo4MGZkRFykGjr0u5UHvBjXRat7Do y0qw== X-Gm-Message-State: AOPr4FWJh9eF9uo6U5BjR87KKeNqWy49JirC9srfqSl8ZX+MOvk2dZvRdESXx9lDYRpUSw== X-Received: by 10.28.226.213 with SMTP id z204mr7971142wmg.99.1461532218279; Sun, 24 Apr 2016 14:10:18 -0700 (PDT) Received: from localhost.localdomain ([46.249.74.23]) by smtp.gmail.com with ESMTPSA id b2sm15440182wmb.9.2016.04.24.14.10.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 24 Apr 2016 14:10:17 -0700 (PDT) From: Ivaylo Dimitrov To: sakari.ailus@iki.fi Cc: sre@kernel.org, pali.rohar@gmail.com, pavel@ucw.cz, linux-media@vger.kernel.org Subject: [RFC PATCH 05/24] smiapp: Add smiapp_has_quirk() to tell whether a quirk is implemented Date: Mon, 25 Apr 2016 00:08:05 +0300 Message-Id: <1461532104-24032-6-git-send-email-ivo.g.dimitrov.75@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461532104-24032-1-git-send-email-ivo.g.dimitrov.75@gmail.com> References: <20160420081427.GZ32125@valkosipuli.retiisi.org.uk> <1461532104-24032-1-git-send-email-ivo.g.dimitrov.75@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sakari Ailus Signed-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-quirk.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/smiapp/smiapp-quirk.h b/drivers/media/i2c/smiapp/smiapp-quirk.h index dac5566..209818f 100644 --- a/drivers/media/i2c/smiapp/smiapp-quirk.h +++ b/drivers/media/i2c/smiapp/smiapp-quirk.h @@ -72,9 +72,12 @@ void smiapp_replace_limit(struct smiapp_sensor *sensor, .val = _val, \ } +#define smiapp_has_quirk(sensor, _quirk) \ + ((sensor)->minfo.quirk && \ + (sensor)->minfo.quirk->_quirk) + #define smiapp_call_quirk(sensor, _quirk, ...) \ - ((sensor)->minfo.quirk && \ - (sensor)->minfo.quirk->_quirk ? \ + (smiapp_has_quirk(sensor, _quirk) ? \ (sensor)->minfo.quirk->_quirk(sensor, ##__VA_ARGS__) : 0) #define smiapp_needs_quirk(sensor, _quirk) \