All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Shishkin <alexander.shishkin@linux.intel.com>
To: Greg KH <greg@kroah.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>,
	Chunyan Zhang <zhang.chunyan@linaro.org>,
	laurent.fert@intel.com, yann.fouassier@intel.com,
	linux-kernel@vger.kernel.org,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>
Subject: [QUEUED v20160408 13/18] intel_th: pti: Create sysfs attributes using core driver's facility
Date: Fri,  8 Apr 2016 17:56:36 +0300	[thread overview]
Message-ID: <1460127401-30801-14-git-send-email-alexander.shishkin@linux.intel.com> (raw)
In-Reply-To: <1460127401-30801-1-git-send-email-alexander.shishkin@linux.intel.com>

The core intel_th driver allows subdevices to bring in their sysfs
attributes. Use this instead of taking care of them in probe and
remove.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
 drivers/hwtracing/intel_th/pti.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/hwtracing/intel_th/pti.c b/drivers/hwtracing/intel_th/pti.c
index 2692cad4c3..35738b5bfc 100644
--- a/drivers/hwtracing/intel_th/pti.c
+++ b/drivers/hwtracing/intel_th/pti.c
@@ -200,7 +200,6 @@ static int intel_th_pti_probe(struct intel_th_device *thdev)
 	struct resource *res;
 	struct pti_device *pti;
 	void __iomem *base;
-	int ret;
 
 	res = intel_th_device_get_resource(thdev, IORESOURCE_MEM, 0);
 	if (!res)
@@ -219,10 +218,6 @@ static int intel_th_pti_probe(struct intel_th_device *thdev)
 
 	read_hw_config(pti);
 
-	ret = sysfs_create_group(&dev->kobj, &pti_output_group);
-	if (ret)
-		return ret;
-
 	dev_set_drvdata(dev, pti);
 
 	return 0;
@@ -230,7 +225,6 @@ static int intel_th_pti_probe(struct intel_th_device *thdev)
 
 static void intel_th_pti_remove(struct intel_th_device *thdev)
 {
-	sysfs_remove_group(&thdev->dev.kobj, &pti_output_group);
 }
 
 static struct intel_th_driver intel_th_pti_driver = {
@@ -238,6 +232,7 @@ static struct intel_th_driver intel_th_pti_driver = {
 	.remove	= intel_th_pti_remove,
 	.activate	= intel_th_pti_activate,
 	.deactivate	= intel_th_pti_deactivate,
+	.attr_group	= &pti_output_group,
 	.driver	= {
 		.name	= "pti",
 		.owner	= THIS_MODULE,
-- 
2.8.0.rc3

  parent reply	other threads:[~2016-04-08 14:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-08 14:56 [QUEUED v20160408 00/18] stm class/intel_th: Patches in my queue Alexander Shishkin
2016-04-08 14:56 ` [QUEUED v20160408 01/18] MAINTAINERS: Add a git tree for the stm class Alexander Shishkin
2016-04-08 14:56 ` [QUEUED v20160408 02/18] stm class: Fix integer boundary checks for master range Alexander Shishkin
2016-04-08 14:56 ` [QUEUED v20160408 03/18] stm class: dummy_stm: Make nr_dummies parameter read-only Alexander Shishkin
2016-04-08 14:56 ` [QUEUED v20160408 04/18] stm class: stm_heartbeat: Make nr_devs " Alexander Shishkin
2016-04-08 14:56 ` [QUEUED v20160408 05/18] stm class: Remove a pointless line Alexander Shishkin
2016-04-08 14:56 ` [QUEUED v20160408 06/18] stm class: Do not leak the chrdev in error path Alexander Shishkin
2016-04-08 14:56 ` [QUEUED v20160408 07/18] stm class: Fix stm device initialization order Alexander Shishkin
2016-04-08 14:56 ` [QUEUED v20160408 08/18] stm class: Remove unnecessary pointer increment Alexander Shishkin
2016-04-08 14:56 ` [QUEUED v20160408 09/18] intel_th: pti: Do remove sysfs group on device removal Alexander Shishkin
2016-04-08 14:56 ` [QUEUED v20160408 10/18] intel_th: msu: Handle kstrndup() failure Alexander Shishkin
2016-04-08 14:56 ` [QUEUED v20160408 11/18] intel_th: Allow subdevice drivers to bring in own attribute groups Alexander Shishkin
2016-04-08 14:56 ` [QUEUED v20160408 12/18] intel_th: msu: Create sysfs attributes using core driver's facility Alexander Shishkin
2016-04-08 14:56 ` Alexander Shishkin [this message]
2016-04-08 14:56 ` [QUEUED v20160408 14/18] intel_th: Fix activating a subdevice without a driver Alexander Shishkin
2016-04-08 14:56 ` [QUEUED v20160408 15/18] intel_th: msu: Serialize enabling/disabling Alexander Shishkin
2016-04-08 14:56 ` [QUEUED v20160408 16/18] intel_th: Hold output driver module reference while capture is active Alexander Shishkin
2016-04-08 14:56 ` [QUEUED v20160408 17/18] intel_th: msu: Set fops::owner to prevent module from unloading Alexander Shishkin
2016-04-08 14:56 ` [QUEUED v20160408 18/18] intel_th: msu: Release resources on removal Alexander Shishkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1460127401-30801-14-git-send-email-alexander.shishkin@linux.intel.com \
    --to=alexander.shishkin@linux.intel.com \
    --cc=greg@kroah.com \
    --cc=laurent.fert@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=yann.fouassier@intel.com \
    --cc=zhang.chunyan@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.