From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AADBC7618B for ; Fri, 26 Jul 2019 09:35:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4867722C7E for ; Fri, 26 Jul 2019 09:35:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726173AbfGZJfv (ORCPT ); Fri, 26 Jul 2019 05:35:51 -0400 Received: from mga11.intel.com ([192.55.52.93]:13379 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725815AbfGZJfv (ORCPT ); Fri, 26 Jul 2019 05:35:51 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jul 2019 02:35:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,310,1559545200"; d="scan'208";a="175546022" Received: from crojewsk-mobl1.ger.corp.intel.com (HELO [10.251.89.116]) ([10.251.89.116]) by orsmga006.jf.intel.com with ESMTP; 26 Jul 2019 02:35:45 -0700 Subject: Re: [RFC PATCH 04/40] soundwire: intel: add debugfs register dump To: Pierre-Louis Bossart Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org, vkoul@kernel.org, gregkh@linuxfoundation.org, jank@cadence.com, srinivas.kandagatla@linaro.org, slawomir.blauciak@intel.com, Sanyog Kale References: <20190725234032.21152-1-pierre-louis.bossart@linux.intel.com> <20190725234032.21152-5-pierre-louis.bossart@linux.intel.com> From: Cezary Rojewski Message-ID: <9d5bc940-eadd-4f82-0bac-6a731369436d@intel.com> Date: Fri, 26 Jul 2019 11:35:44 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190725234032.21152-5-pierre-louis.bossart@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-07-26 01:39, Pierre-Louis Bossart wrote: > +static void intel_debugfs_init(struct sdw_intel *sdw) > +{ > + struct dentry *root = sdw->cdns.bus.debugfs; > + > + if (!root) > + return; > + > + sdw->fs = debugfs_create_dir("intel-sdw", root); > + if (IS_ERR_OR_NULL(sdw->fs)) { > + dev_err(sdw->cdns.dev, "debugfs root creation failed\n"); > + sdw->fs = NULL; > + return; > + } > + > + debugfs_create_file("intel-registers", 0400, sdw->fs, sdw, > + &intel_reg_fops); > + > + sdw_cdns_debugfs_init(&sdw->cdns, sdw->fs); > +} I believe there should be dummy equivalent of _init and _exit if debugfs is not enabled (if these are defined already and I've missed it, please ignore). > +static void intel_debugfs_exit(struct sdw_intel *sdw) > +{ > + debugfs_remove_recursive(sdw->fs); > +}