Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5946339ybi; Wed, 31 Jul 2019 05:56:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyWjaiQGwtN/RsEz5o9uvb79OtCsBtFZrRdqSElspqAej7F+8SOL0/C4mo4MG/b/sAedBEt X-Received: by 2002:a17:90a:bc42:: with SMTP id t2mr2846510pjv.121.1564577808303; Wed, 31 Jul 2019 05:56:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564577808; cv=none; d=google.com; s=arc-20160816; b=j1gQM2eDTBq9UqBBsKqgJoE1kiWimn5TA3cZtimgENZ3HbOjWT9dMR76lJiQmz93ob DMZXDDT0/hb9BkxSp1YyH/v5TpNL0rHg3TU4P7ueiGN9ziawd/DnOsbcLhlT9lyjY4M9 9xjZXot11iORlvLMC2/hYLrJa8fNNncf6T94XFmKXeIwOBVp7Nf3cuLQiIkmMS/TckB/ 8u8AdW7gTcb0WBczWHVRUKoEvo9PuhlMkk5ZvSM9IolFu+rxPrjKcsQzXvzoYFh8rYNh txbiSp/aHsEwfcKF6TDG5JXVykN0MWtwo5Nd2g65M5UUQ3NFvzoJY3ODfJ5VO01izWnR HnDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GsRftscQPfLJZWFDpnDLN0BaQ+4tvjoMxxK2rRQAI/U=; b=kJZDOZLRV+a/2nY/FDg8Un1pRbFZ4U0t2wMDwk8sOgeUTfvKwCTHdg6fD/6WIVvHOp 4A2wNEz1qH+URCZ9pHo5K3uoW7j0jew6QLeUtRtCy8MjhTmGJZWhvrnE9H5j/ca9AH+q w4LJtpNPCugK22RLM2nqYPAFottWLC+GqSYW4hoKkkTh7SIWz6P3Eiu7rKaBiEXVi3lO OoV6fdOJikFycte/eH2sutIJz2KAwBTWNj03q+l//K+ZmK5/XdmrttGGXpt88j+pIjIe 3YItMgMUTAeUZqnbT7DMxwm68mHgmIX+sKS4Lm5H9ZQ1/eW1q3qpk5iITrLc1hLnkNJy 1Z0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tDKo50NG; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s132si32285672pfc.244.2019.07.31.05.56.33; Wed, 31 Jul 2019 05:56:48 -0700 (PDT) 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=@kernel.org header.s=default header.b=tDKo50NG; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388002AbfGaMoJ (ORCPT + 99 others); Wed, 31 Jul 2019 08:44:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:36410 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387985AbfGaMoI (ORCPT ); Wed, 31 Jul 2019 08:44:08 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6C742206B8; Wed, 31 Jul 2019 12:44:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564577047; bh=OpLDvIxJpuqw1Y07+slcLl/ar6SV0gGmWVthQGmxjtk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tDKo50NGE77WI8eo25aSgbqjia32TVpK0C4drtWImg+lv0lYu8kouDCPwYoBZ+33x TsM21lwfHU9khTHftDxdEPLcp/RrmiZlgI+vKVgy8xyHKSvZi7qEXmF0xlP/qKnzDH Z+Wz83KvK4VrGhJ8CYiSZzZZyqwfRQk21DiKFWEE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, Richard Gong , Dmitry Torokhov Cc: Greg Kroah-Hartman Subject: [PATCH v2 02/10] uio: uio_fsl_elbc_gpcm: convert platform driver to use dev_groups Date: Wed, 31 Jul 2019 14:43:41 +0200 Message-Id: <20190731124349.4474-3-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190731124349.4474-1-gregkh@linuxfoundation.org> References: <20190731124349.4474-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Platform drivers now have the option to have the platform core create and remove any needed sysfs attribute files. So take advantage of that and do not register "by hand" a sysfs group of attributes. Signed-off-by: Greg Kroah-Hartman --- drivers/uio/uio_fsl_elbc_gpcm.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/uio/uio_fsl_elbc_gpcm.c b/drivers/uio/uio_fsl_elbc_gpcm.c index 450e2f5c9b43..be8a6905f507 100644 --- a/drivers/uio/uio_fsl_elbc_gpcm.c +++ b/drivers/uio/uio_fsl_elbc_gpcm.c @@ -71,6 +71,13 @@ static ssize_t reg_store(struct device *dev, struct device_attribute *attr, static DEVICE_ATTR(reg_br, 0664, reg_show, reg_store); static DEVICE_ATTR(reg_or, 0664, reg_show, reg_store); +static struct attribute *uio_fsl_elbc_gpcm_attrs[] = { + &dev_attr_reg_br.attr, + &dev_attr_reg_or.attr, + NULL, +}; +ATTRIBUTE_GROUPS(uio_fsl_elbc_gpcm); + static ssize_t reg_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -411,25 +418,12 @@ static int uio_fsl_elbc_gpcm_probe(struct platform_device *pdev) /* store private data */ platform_set_drvdata(pdev, info); - /* create sysfs files */ - ret = device_create_file(priv->dev, &dev_attr_reg_br); - if (ret) - goto out_err3; - ret = device_create_file(priv->dev, &dev_attr_reg_or); - if (ret) - goto out_err4; - dev_info(priv->dev, "eLBC/GPCM device (%s) at 0x%llx, bank %d, irq=%d\n", priv->name, (unsigned long long)res.start, priv->bank, irq != NO_IRQ ? irq : -1); return 0; -out_err4: - device_remove_file(priv->dev, &dev_attr_reg_br); -out_err3: - platform_set_drvdata(pdev, NULL); - uio_unregister_device(info); out_err2: if (priv->shutdown) priv->shutdown(info, true); @@ -448,8 +442,6 @@ static int uio_fsl_elbc_gpcm_remove(struct platform_device *pdev) struct uio_info *info = platform_get_drvdata(pdev); struct fsl_elbc_gpcm *priv = info->priv; - device_remove_file(priv->dev, &dev_attr_reg_or); - device_remove_file(priv->dev, &dev_attr_reg_br); platform_set_drvdata(pdev, NULL); uio_unregister_device(info); if (priv->shutdown) @@ -474,6 +466,7 @@ static struct platform_driver uio_fsl_elbc_gpcm_driver = { .driver = { .name = "fsl,elbc-gpcm-uio", .of_match_table = uio_fsl_elbc_gpcm_match, + .dev_groups = uio_fsl_elbc_gpcm_groups, }, .probe = uio_fsl_elbc_gpcm_probe, .remove = uio_fsl_elbc_gpcm_remove, -- 2.22.0