Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11968101ybi; Fri, 26 Jul 2019 02:37:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHxoUtjz8vWCckEHtnoPFOYXEyQZdZCZV7O3q5uvqgdMjSnxmhc5M8YpsPIBae0YOPDLKW X-Received: by 2002:aa7:9146:: with SMTP id 6mr20602414pfi.67.1564133820022; Fri, 26 Jul 2019 02:37:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564133820; cv=none; d=google.com; s=arc-20160816; b=H8SdBpOimAPniN5uIjWUm+DCBTfqj1+P//hqoMhTVrf/HH3y0bamXNcYBDdcr5YkBH WWTL+ERL/e/IReAuOpG23rp4M31RJB9COeJ/CwVcg9TX13k2HbcAFAzIKJ7VyPdMPgxk J9BqbZXUx4CS33d3guldf7p6MtT31UTX0FmN1hmnA3jFkzKrPBscoWhjihCFj7KSq84R 0IENPj3kiHvJVL1VFHEt/ogxiI8LQiLE9wUCKRmMJbEtw8tCJ+3+lKBMm+dCZP7ci3oQ mSj1m3BX4uUdwznZ7FGB88Ct86e/5Otd7788ARfxOpds8r7DWbb4iIzBmMvn3Lcrp8M+ jsvA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=elYw1Usx9FZr9Tu0MF84JfrLOBRhVIuyXP5ZOfgsU88=; b=JnHKeFicDhYiqQ2AeP8h83jcrlQUZAr4uFL/aOsnM5igZmIiJdRPVmbSda3JX81eeq NBc0pqeOvHPJy7bbegyCbsHz7Ct5Fuz/JwzfnHEIXnGGsBbhqFouLhO3e0zoNfZUvyHl zmV1nyhxCyNx1CUWF4R8QPSLESt3VA2uVKIrXuzuJ+GpF9KVaATOu09Oxl77dKVpiLTq zmILYG9CVdYa961nWE9rUErJtevCN3hDq3GqBW/GAiGtF2jJsOhDsfPA4bUGAWe2GwLj g2fVuUaog6lvpzARtkNEuxM7rmvadvKiN+upPhwKZiOX5ICRVAyLctC2ipr99FCA0UYn 0V7Q== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p17si22021664plq.138.2019.07.26.02.36.44; Fri, 26 Jul 2019 02:37:00 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726129AbfGZJfv (ORCPT + 99 others); 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); > +}