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=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 2AC70C48BCD for ; Wed, 9 Jun 2021 08:42:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1369F61364 for ; Wed, 9 Jun 2021 08:42:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236917AbhFIIov (ORCPT ); Wed, 9 Jun 2021 04:44:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232555AbhFIIou (ORCPT ); Wed, 9 Jun 2021 04:44:50 -0400 Received: from mail.kernel-space.org (unknown [IPv6:2a01:4f8:c2c:5a84::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0063CC061574; Wed, 9 Jun 2021 01:42:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-space.org; s=20190913; t=1623228172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=W4D/dpUy534xRRA2sZUtaIC4SgpgY4O+HXQSIzIZp78=; b=wZpvd7z4IROFubBJlsm4Cdhg4s60EYQpH/srv9SQcOFr4gjlGXjMpNLumJCry5GzJmEKD5 sItdzdcgu4F6IRHcCbeYkvQsz6uVc5LRRjEBf4P9aI11fN4V39IVOiU7gng1csc6zXonu9 M46ySd6MupUW426EEF+bNHyP/40E8x0= Received: from [192.168.0.2] (host-87-8-57-171.retail.telecomitalia.it [87.8.57.171]) by ziongate (OpenSMTPD) with ESMTPSA id 5ed4e878 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 9 Jun 2021 08:42:52 +0000 (UTC) Subject: Re: [PATCH 5/5] can: flexcan: add mcf5441x support To: Geert Uytterhoeven , Joakim Zhang Cc: "gerg@linux-m68k.org" , "wg@grandegger.com" , "mkl@pengutronix.de" , "linux-m68k@vger.kernel.org" , "linux-can@vger.kernel.org" References: <20210608204542.983925-1-angelo@kernel-space.org> <20210608204542.983925-5-angelo@kernel-space.org> From: Angelo Dureghello Message-ID: <5f848026-fa3e-b50a-3d8d-2a047d429f65@kernel-space.org> Date: Wed, 9 Jun 2021 10:42:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-can@vger.kernel.org Hi Geert, On 09/06/21 10:12 AM, Geert Uytterhoeven wrote: > Hi Joakim, Angelo, > > On Wed, Jun 9, 2021 at 4:05 AM Joakim Zhang wrote: >>> From: Angelo Dureghello >>> Sent: 2021年6月9日 4:46 >>> To: gerg@linux-m68k.org; wg@grandegger.com; mkl@pengutronix.de >>> Cc: geert@linux-m68k.org; linux-m68k@vger.kernel.org; >>> linux-can@vger.kernel.org; Joakim Zhang ; >>> Angelo Dureghello >>> Subject: [PATCH 5/5] can: flexcan: add mcf5441x support >>> >>> Add flexcan support for NXP ColdFire mcf5441x family. >>> >>> This flexcan module is quite similar to imx6 flexcan module, but with some >>> exceptions: >>> >>> - 3 separate interrupt sources, MB, BOFF and ERR, >>> - implements 16 mb only, >>> - m68k architecture is not supporting devicetrees, so a >>> platform data check/case has been added, >>> - ColdFire is m68k, so big-endian cpu, with a little-endian flexcan >>> module. >>> >>> Signed-off-by: Angelo Dureghello > >>> --- a/drivers/net/can/flexcan.c >>> +++ b/drivers/net/can/flexcan.c > >>> @@ -637,13 +650,17 @@ static int flexcan_clks_enable(const struct >>> flexcan_priv *priv) { >>> int err; >>> >>> - err = clk_prepare_enable(priv->clk_ipg); >>> - if (err) >>> - return err; >>> + if (priv->clk_ipg) { >>> + err = clk_prepare_enable(priv->clk_ipg); >>> + if (err) >>> + return err; >>> + } >>> >>> - err = clk_prepare_enable(priv->clk_per); >>> - if (err) >>> - clk_disable_unprepare(priv->clk_ipg); >>> + if (priv->clk_per) { >>> + err = clk_prepare_enable(priv->clk_per); >>> + if (err) >>> + clk_disable_unprepare(priv->clk_ipg); >>> + } >> >> No need do this check, it will be handled in clk_prepare_enable() / clk_disable_unprepare(). So this change is unnecessary. > > Except that the non-CCF implementation of clk_enable() in > arch/m68k/coldfire/clk.c still returns -EINVAL instead of NULL. > Any plans to move to CCF? Or at least fix legacy clk_enable(). > >>> @@ -2091,6 +2133,11 @@ static int flexcan_probe(struct platform_device >>> *pdev) >>> >>> devtype_data = of_device_get_match_data(&pdev->dev); >>> >>> + if (pdata && !devtype_data) { >>> + devtype_data = >>> + (struct flexcan_devtype_data *)&fsl_mcf_devtype_data; > > Cast not needed? > Thanks, fixed for v2. > Gr{oetje,eeting}s, > > Geert > Regards, -- Angelo Dureghello +++ kernelspace +++ +E: angelo AT kernel-space.org +W: www.kernel-space.org