Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7580599imu; Fri, 28 Dec 2018 00:45:41 -0800 (PST) X-Google-Smtp-Source: ALg8bN5GPIZjQnaB7aAIwmxDu7aq1YhIZoM02/1EOVgz5q1y+NkP3ySL9HESvEnUU2vq4Hf0I4z7 X-Received: by 2002:a17:902:850c:: with SMTP id bj12mr26195454plb.46.1545986741927; Fri, 28 Dec 2018 00:45:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545986741; cv=none; d=google.com; s=arc-20160816; b=eSZzJFrbzjdaVKFpcV0DlAMYY9bPyaGJFIT6pfx7M12IHRXfAm0pCCXE3jD7eyoQE1 6w7i+9D76MjZe4CEwQS/qCfU3IEn66EXJV5Xq5xNMNYZweR6QC3mCZ3CgtbWuk33pwHT yn3PUGrEJd/GKkA4+Zudq/IvfK47Yyi6AmkryjVTL32JtSA3gyGEk0X3JyfFDQz8H0cy +57Iu/i6yfQno/SsJcDafhC9ME+UMaSDvxFKRAsHyAKCTv1Gnerz2+neeUoqDGfY97AF zLsZ7h73RZvOtGUAgWs/vJ58itnfg+CZcChVRfiLzXby3xXUIq4cHdBHUJVKTStEspGf zaPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:in-reply-to:user-agent:from:cc :subject:references:message-id:to:content-transfer-encoding :mime-version:dkim-signature; bh=0iWOsNLZJLca55tquo03aBz3NQX11fqi22euNDOW1Fk=; b=TSgvli+C1x1sVkyVXkjuI7BeX2fpfGV3uBdBwZWL7A9zcSGN63wVRpSQmsbUHdHNkf 7q6fAWf/QopH7uvqyj6egs1hNuRHhNeW4ZYu5nhOK3duvjx4xUfTRBKUTz2Tc1jzd4Ju coBT7P2MYfBwFtBfYO88OT2KA5LtQaH42NfrSNJwYX4slcU6+GJY7SKMNKkjDELsKUwz 4523DIiTw65Y/cWtL6bGwhENsbDdHmUOiQxRXWb5aS+wLHtwme9sk6CSuCy50ONvBYYI WFk/7IF1uFGg/Iq9/naS0+88lQSbr9Q4YBaRJ8b5FbihXvt5DbhVhSuOhJMsN8JTnxDW Ga+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BrT+HptP; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e126si22521832pfh.185.2018.12.28.00.45.25; Fri, 28 Dec 2018 00:45:41 -0800 (PST) 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=BrT+HptP; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730467AbeL1Aj2 (ORCPT + 99 others); Thu, 27 Dec 2018 19:39:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:45052 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726868AbeL1Aj1 (ORCPT ); Thu, 27 Dec 2018 19:39:27 -0500 Received: from localhost (unknown [104.132.0.74]) (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 E33682148E; Fri, 28 Dec 2018 00:39:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545957567; bh=1ddqU3RtRwJWXxclcxRkIZinYqh+4vVVHA0QuoYWCAg=; h=To:References:Subject:Cc:From:In-Reply-To:Date:From; b=BrT+HptPTHXixErxKdZK0ULHXTRmcI5npZLplUBH05ts30fXdkPbeEcv/FjdiTbBC +ZFmMxkL1t0yBrCGKr9qL2Urcb58QJVtfb07U1oB/sKPThRCwrxuMl7aXxUqj+L1IF Vj/CtYNqbUZKwtOI2AU5xa0GrCHrcWlVIHprW77I= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: "Sugaya, Taichi" , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Message-ID: <154595756614.179992.794211301759568891@swboyd.mtv.corp.google.com> References: <1542589274-13878-1-git-send-email-sugaya.taichi@socionext.com> <1542589274-13878-8-git-send-email-sugaya.taichi@socionext.com> <154356669840.88331.4455990896653868594@swboyd.mtv.corp.google.com> <9fba4689-b20f-c18a-ea11-d961de497ea3@socionext.com> Subject: Re: [PATCH 07/14] clock: milbeaut: Add Milbeaut M10V clock control Cc: Michael Turquette , Rob Herring , Mark Rutland , Greg Kroah-Hartman , Daniel Lezcano , Thomas Gleixner , Russell King , Jiri Slaby , Masami Hiramatsu , Jassi Brar From: Stephen Boyd User-Agent: alot/0.8 In-Reply-To: <9fba4689-b20f-c18a-ea11-d961de497ea3@socionext.com> Date: Thu, 27 Dec 2018 16:39:26 -0800 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Sugaya, Taichi (2018-12-25 17:35:27) > Hi >=20 > On 2018/11/30 17:31, Stephen Boyd wrote: > >> + init.num_parents =3D parents; > >> + init.parent_names =3D parent_names; > >> + > >> + mcm->cname =3D clk_name; > >> + mcm->parent =3D 0; > >> + mcm->hw.init =3D &init; > >> + > >> + clk =3D clk_register(NULL, &mcm->hw); > >> + if (IS_ERR(clk)) > >> + goto err_clk; > >> + > >> + of_clk_add_provider(node, of_clk_src_simple_get, clk); > >> + return; > >> + > >> +err_clk: > >> + kfree(mcm); > >> +err_mcm: > >> + kfree(parent_names); > >> +} > >> +CLK_OF_DECLARE(m10v_clk_mux, "socionext,milbeaut-m10v-clk-mux", > >> + m10v_clk_mux_setup); > >=20 > > Any chance you can use a platform driver? > >=20 >=20 > Excuse me to re-ask you. > Why do you recommend to use a platform driver? Is that current fad? Not exactly a fad. We've been doing it for some time now. From an older email on the list: Reasons (in no particular order): 1. We get a dev pointer to use with clk_hw_register() 2. We can handle probe defer if some resource is not available 3. Using device model gets us a hook into power management frameworks like runtime PM and system PM for things like suspend and hibernate 4. It encourages a single DT node clk controller style binding instead of a single node per clk style binding 5. We can use non-DT specific functions like devm_ioremap_resource() to m= ap registers and acquire other resources, leading to more portable and generic code 6. We may be able to make the device driver a module, which will make distros happy if we don't have to compile in all these clk drivers to the resulting vmlinux