Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2713389pxb; Tue, 12 Oct 2021 11:56:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlrn1He361uisxHoMlfSg2rADa5k1KA+f3KyPP1x+UrtPS0EkbIo6XOlUb4OD+fjkVVlHu X-Received: by 2002:a63:4b5b:: with SMTP id k27mr23729614pgl.294.1634065011848; Tue, 12 Oct 2021 11:56:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634065011; cv=none; d=google.com; s=arc-20160816; b=zXdwAWmXXHGKhwb/YeeTaGFV7xWN10ztOcrhsBS6NPiL/uKvGjNpMt6CHhlpuuxGQA Odzuo8PM1xfg6r+dJYMxeuWlSa12ZGzXP30QGSmC/GByXxmVh/XGFuEgiz3jOI6P/ART fqEWel2ga6L6vJlDzvs2y439LPY/lQBOXeQwa2AKyhFLx3LBy2HEyK5a/Rj50SRM/dBl dz2dkP4RPQA1sLBMIU52xYBqFwGhu7NHeizSJZIDdNxaST3vJcbAi/yVgDRqL+dYZcAC x2dn9caIcIvfmsLA/4feBXdMyl36vpxaSSNwBTV6QGv6qxs9HMCOokfghMxdZSHQTsX7 w57A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=WCqYJ3QHrj7n8NCCkRGP1z0mcT3E3XFBllb+1nsIsdM=; b=UupgIGb/D1lwXjuqhGbiYq/slQobG4UXVl3goebz+qZJ+tTTivfr16VBbq3m7vHXIT Z9WFbS8nHusl8ihAu777OKGIkXYEucqoiHfI9zkHSZbHh84jqzsOhI8N5F7q4WtFGVM4 s2LNGcOfz6BnnUdofNOw7AIqRSXuO1f2wVpbPdme7a3AIIydRI111DwvjTh4eXIBJZHy uOr6dxlRcRNxaa1oiLOGOGk9pAzXhmDQ9Vm7It2MsVGElEJ92uDoeBqFCBxE3Jpz/0sD jZBMcTiM7d9uNBC6d5BPtFq80ovkHDg6qg0j46WFwV034twUwRYMta60AEQK6I1VIzq7 k89w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id u13si16986865pfi.122.2021.10.12.11.56.39; Tue, 12 Oct 2021 11:56:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S234052AbhJLS5r (ORCPT + 99 others); Tue, 12 Oct 2021 14:57:47 -0400 Received: from mga05.intel.com ([192.55.52.43]:2108 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230427AbhJLS5q (ORCPT ); Tue, 12 Oct 2021 14:57:46 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10135"; a="313439092" X-IronPort-AV: E=Sophos;i="5.85,368,1624345200"; d="scan'208";a="313439092" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2021 11:55:43 -0700 X-IronPort-AV: E=Sophos;i="5.85,368,1624345200"; d="scan'208";a="562785007" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.159]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2021 11:55:40 -0700 Received: from andy by smile with local (Exim 4.95) (envelope-from ) id 1maMw5-0003LT-BZ; Tue, 12 Oct 2021 21:55:37 +0300 Date: Tue, 12 Oct 2021 21:55:37 +0300 From: Andy Shevchenko To: Sam Protsenko Cc: Michael Turquette , Stephen Boyd , Russell King , Chanwoo Choi , Sylwester Nawrocki , Krzysztof Kozlowski , Mike Tipton , Andy Shevchenko , Geert Uytterhoeven , Fabio Estevam , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5] clk: Add write operation for clk_parent debugfs node Message-ID: References: <20211007182158.7490-1-semen.protsenko@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211007182158.7490-1-semen.protsenko@linaro.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 07, 2021 at 09:21:58PM +0300, Sam Protsenko wrote: > Useful for testing mux clocks. One can write the index of the parent to > be set into clk_parent node, starting from 0. Example > > # cd /sys/kernel/debug/clk/mout_peri_bus > # cat clk_possible_parents > dout_shared0_div4 dout_shared1_div4 > # cat clk_parent > dout_shared0_div4 > # echo 1 > clk_parent > # cat clk_parent > dout_shared1_div4 > > CLOCK_ALLOW_WRITE_DEBUGFS has to be defined in drivers/clk/clk.c in > order to use this feature. ... > +#ifdef CLOCK_ALLOW_WRITE_DEBUGFS > + if (core->num_parents > 1) > + debugfs_create_file("clk_parent", 0644, root, core, > + ¤t_parent_rw_fops); > + else > +#endif > + { > + if (core->num_parents > 0) > + debugfs_create_file("clk_parent", 0444, root, core, > + ¤t_parent_fops); > + } Currently there is no need to add the {} along with increased indentation level. I.o.w. the 'else if' is valid in C. -- With Best Regards, Andy Shevchenko