Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755324Ab3GJUGp (ORCPT ); Wed, 10 Jul 2013 16:06:45 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54593 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755206Ab3GJUFh (ORCPT ); Wed, 10 Jul 2013 16:05:37 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: oliver+list@schinagl.nl, linux@roeck-us.net, khali@linux-fr.org, Greg Kroah-Hartman Subject: [PATCH 4/6] driver core: add DEVICE_ATTR_RW and DEVICE_ATTR_RO macros Date: Wed, 10 Jul 2013 13:05:12 -0700 Message-Id: <1373486714-14531-5-git-send-email-gregkh@linuxfoundation.org> X-Mailer: git-send-email 1.8.3.rc0.20.gb99dd2e In-Reply-To: <1373486714-14531-1-git-send-email-gregkh@linuxfoundation.org> References: <1373486714-14531-1-git-send-email-gregkh@linuxfoundation.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1238 Lines: 31 Make it easier to create attributes without having to always audit the mode settings. Signed-off-by: Greg Kroah-Hartman --- include/linux/device.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/device.h b/include/linux/device.h index bcf8c0d..1d546a0 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -512,6 +512,10 @@ ssize_t device_store_bool(struct device *dev, struct device_attribute *attr, #define DEVICE_ATTR(_name, _mode, _show, _store) \ struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store) +#define DEVICE_ATTR_RW(_name) \ + struct device_attribute dev_attr_##_name = __ATTR_RW(_name) +#define DEVICE_ATTR_RO(_name) \ + struct device_attribute dev_attr_##_name = __ATTR_RO(_name) #define DEVICE_ULONG_ATTR(_name, _mode, _var) \ struct dev_ext_attribute dev_attr_##_name = \ { __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) } -- 1.8.3.rc0.20.gb99dd2e -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/