From patchwork Fri Nov 8 05:19:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 178850 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp2158660ilf; Thu, 7 Nov 2019 21:20:11 -0800 (PST) X-Google-Smtp-Source: APXvYqz3TcnU522eh6YIBh8Zr4AFvrPyBF5F6IZ/MmnKEH+wl31l6P+eG7lkJObrINgKxEHEsE+t X-Received: by 2002:a17:906:958b:: with SMTP id r11mr7016004ejx.332.1573190411868; Thu, 07 Nov 2019 21:20:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573190411; cv=none; d=google.com; s=arc-20160816; b=ouLBEau09DQRg+b0BuqePWz3XAyLkHY/6uC9Str+kY5eU8A2Dtlxl3AMLmHCCfPp/O MZkFltVq9IIOO3RbLT1T152Oue4mkv3//Ajb0FQlfNs5515cq/1E63YmNoc9QXx1KDQO IizK9OdGNmKxSoBxcqaD83UgLU9hWimJ8dEX3U+uSEuZHmpuz+TiB6XEd4OgAEsm8Yo/ MdyHfVkuaTW3jThkMYUM3HpJScvvb4FZd1NdrnpymhtsHTnCrI1Ork3/GZJTDbwgtsQG DVqlQQk2kUOBnmhJqvLNcBlhfkN3Lg/rUPPl/RagEi0otHVJ6BOCov9pmc9mBBQgzyVb 0O0A== 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=VminkHZjPJEfcePoxrblVvTvuZD1weWd1AQS3sguLYY=; b=ga7Ewli/MzPerDPULTxxEJ5z1lQmAKzM0zZFbfE0/lMLyapo4t/AxwvqKh8p50kKG4 YxtvPzTxXIkcHK55jkOrTV8uZKIs4Dq/eUnkIrOxuvOYpkA10+IqqMkRYtHhWyXPLGTD EResfJxQu78UqVelC8LajOQ9plTDASeytEWSaK6Q4OrthlWIEi/2Lk85WhDe0XTp6TGE 9n5ZodJMYxR06cmFig2zQBhgiSclUq2/IDmtXTZvaNlMvqukGfpkg4/tH/2YoVaFyFjS CIov16r/iES/wOEi2arnAgau8CyICAzvXtLkAvVOGNMTBCG5WfBcWeik19Pj5ucBNGVD 7gGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=F4Uy3yD+; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 u24si3676492edl.447.2019.11.07.21.20.11; Thu, 07 Nov 2019 21:20:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=F4Uy3yD+; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726725AbfKHFUL (ORCPT + 8 others); Fri, 8 Nov 2019 00:20:11 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:40515 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726307AbfKHFUK (ORCPT ); Fri, 8 Nov 2019 00:20:10 -0500 Received: by mail-pl1-f194.google.com with SMTP id e3so3267295plt.7; Thu, 07 Nov 2019 21:20:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VminkHZjPJEfcePoxrblVvTvuZD1weWd1AQS3sguLYY=; b=F4Uy3yD+3BM4e+yIRyLCZ6rTAtOy0OQPlCK/2TUXc4gKNGRYxG2Mt1jMMXy4po+n0s 4hkPi1wqrR3vk8JWcA9cWgkd7Wmsv2NzhYyKsbAYQeUzbDVoqA5gloJY9E+R/tT5PSSc GeZzJmm4sfUzbDZcexDaZsru6xBlLuZPo7T16Z06TRBKx3mhnbjoROjGxkfvj6NWqZO3 hqIDpRJEQMO8cGXgVWL95wU9Ow3Gfr9ZGtzeT/rdTNAfpYd58csKrfjWoITfQYxABx9l SqhYsoIJ9V0JURmQdQGQXRm8mjpQ1XVR2JYFONopnXHaHECrnSKBgvQulzJnF8CcHSeW 84bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=VminkHZjPJEfcePoxrblVvTvuZD1weWd1AQS3sguLYY=; b=Oy+ShMU5M/flUMA3Z9/jb8I4gkHstj7ESKnZ3ooaoODLKm7wwklhwLbde7cGDEX0os dxDlx0lj1AwTZYphta/Y10Z31TtDAHsciBFWmu0akixlO36llwzosZp/YFM4KDc/bK74 ZKW5oA4ezSSJA45NmZQMrC1XTCLSf+qoDjEyVh+jn80/M+I6IwayGNUXLy24G6D0rgpp s4AE/bMfx00jYmAHWWmjY1y5K3P5e+WbWJeiEefQiDDyv++x77g8vRN8/TMI5y/Fw7sJ ky6DnQKTNZhCiHjwL1yBcjc/f7X1lXL8roisecQpkZSolemiHj4JexXNPRkNSKYgBNwz XxaQ== X-Gm-Message-State: APjAAAX+Dvf4Ma9Lklvb0m4ph33GG99kKgaOnKmm0lMyXzmfZ2czVROp WPtjgFhVjZYgjlJqR8iPgok= X-Received: by 2002:a17:90a:c68f:: with SMTP id n15mr3170444pjt.20.1573190409931; Thu, 07 Nov 2019 21:20:09 -0800 (PST) Received: from voyager.ibm.com ([36.255.48.244]) by smtp.gmail.com with ESMTPSA id v19sm3798443pjr.14.2019.11.07.21.20.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2019 21:20:09 -0800 (PST) From: Joel Stanley To: Rob Herring , Greg KH , Jeremy Kerr Cc: Alistar Popple , Eddie James , Steven Rostedt , Ingo Molnar , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-fsi@lists.ozlabs.org Subject: [PATCH v2 02/11] fsi: Move master attributes to fsi-master class Date: Fri, 8 Nov 2019 15:49:36 +1030 Message-Id: <20191108051945.7109-3-joel@jms.id.au> X-Mailer: git-send-email 2.24.0.rc1 In-Reply-To: <20191108051945.7109-1-joel@jms.id.au> References: <20191108051945.7109-1-joel@jms.id.au> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Jeremy Kerr Populate fsi_master_class->dev_attrs with the existing attribute definitions, so we don't need to explicitly register. Signed-off-by: Jeremy Kerr Signed-off-by: Joel Stanley --- drivers/fsi/fsi-core.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) -- 2.24.0.rc1 Acked-by: Alistair Popple diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index 0861f6097b33..c773c65a5058 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -1241,8 +1241,17 @@ static ssize_t master_break_store(struct device *dev, static DEVICE_ATTR(break, 0200, NULL, master_break_store); +static struct attribute *master_attrs[] = { + &dev_attr_break.attr, + &dev_attr_rescan.attr, + NULL +}; + +ATTRIBUTE_GROUPS(master); + struct class fsi_master_class = { .name = "fsi-master", + .dev_groups = master_groups, }; int fsi_master_register(struct fsi_master *master) @@ -1261,20 +1270,6 @@ int fsi_master_register(struct fsi_master *master) return rc; } - rc = device_create_file(&master->dev, &dev_attr_rescan); - if (rc) { - device_del(&master->dev); - ida_simple_remove(&master_ida, master->idx); - return rc; - } - - rc = device_create_file(&master->dev, &dev_attr_break); - if (rc) { - device_del(&master->dev); - ida_simple_remove(&master_ida, master->idx); - return rc; - } - np = dev_of_node(&master->dev); if (!of_property_read_bool(np, "no-scan-on-init")) { mutex_lock(&master->scan_lock);