From patchwork Wed Aug 5 13:39:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heikki Krogerus X-Patchwork-Id: 6949691 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@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 593169F39D for ; Wed, 5 Aug 2015 13:42:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8F9F8203E3 for ; Wed, 5 Aug 2015 13:42:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A43D2203B0 for ; Wed, 5 Aug 2015 13:42:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753011AbbHENjS (ORCPT ); Wed, 5 Aug 2015 09:39:18 -0400 Received: from mga01.intel.com ([192.55.52.88]:15050 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751493AbbHENjP (ORCPT ); Wed, 5 Aug 2015 09:39:15 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 05 Aug 2015 06:39:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,617,1432623600"; d="scan'208";a="742687611" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.157]) by orsmga001.jf.intel.com with ESMTP; 05 Aug 2015 06:39:11 -0700 From: Heikki Krogerus To: Johannes Berg Cc: "Rafael J. Wysocki" , Mika Westerberg , Andy Shevchenko , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH 1/5] device property: helper macros for property entry creation Date: Wed, 5 Aug 2015 16:39:03 +0300 Message-Id: <1438781947-7952-2-git-send-email-heikki.krogerus@linux.intel.com> X-Mailer: git-send-email 2.4.6 In-Reply-To: <1438781947-7952-1-git-send-email-heikki.krogerus@linux.intel.com> References: <1438781947-7952-1-git-send-email-heikki.krogerus@linux.intel.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 Marcos for easier creation of build-in property entries. Signed-off-by: Heikki Krogerus --- include/linux/property.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/include/linux/property.h b/include/linux/property.h index 76ebde9..204d899 100644 --- a/include/linux/property.h +++ b/include/linux/property.h @@ -152,6 +152,41 @@ struct property_entry { } value; }; +#define PROP_ENTRY_U8(_name_, _val_) { \ + .name = _name_, \ + .type = DEV_PROP_U8, \ + .nval = 1, \ + .value.u8_data = _val_, \ +} + +#define PROP_ENTRY_U16(_name_, _val_) { \ + .name = _name_, \ + .type = DEV_PROP_U16, \ + .nval = 1, \ + .value.u16_data = _val_, \ +} + +#define PROP_ENTRY_U32(_name_, _val_) { \ + .name = _name_, \ + .type = DEV_PROP_U32, \ + .nval = 1, \ + .value.u32_data = _val_, \ +} + +#define PROP_ENTRY_U64(_name_, _val_) { \ + .name = _name_, \ + .type = DEV_PROP_U64, \ + .nval = 1, \ + .value.u64_data = _val_, \ +} + +#define PROP_ENTRY_STRING(_name_, _val_) { \ + .name = _name_, \ + .type = DEV_PROP_STRING, \ + .nval = 1, \ + .value.str = (const char **)_val_, \ +} + /** * struct property_set - Collection of "built-in" device properties. * @fwnode: Handle to be pointed to by the fwnode field of struct device.