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.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 29D06C48BE6 for ; Fri, 11 Jun 2021 09:06:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 135BE61278 for ; Fri, 11 Jun 2021 09:06:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231396AbhFKJIN (ORCPT ); Fri, 11 Jun 2021 05:08:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:33200 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231251AbhFKJIM (ORCPT ); Fri, 11 Jun 2021 05:08:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 157D961278; Fri, 11 Jun 2021 09:06:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623402361; bh=V8rwQSPoiZTRk/jjRyvlQpQ1iIHmDQKQlGADOqOkmGs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lSsqjcdINb99LnurddKz51NDkHxokfj0nSeOELsQ8ON5ZQQ9cwd30j5b74FbN+CDp gojDDtF2W8omSjn+/fFTB25cA8p2ONkJcw0olabKA0Bg0PBeQhiqa8nXJ7pAGHRbLh 3YZznU2rbyCsMisqO38iavqLi4fYfFC5oCyl38V8= Date: Fri, 11 Jun 2021 11:05:59 +0200 From: Greg Kroah-Hartman To: Sebastian Reichel Cc: Mark Brown , Rob Herring , Arnd Bergmann , Shawn Guo , Sascha Hauer , Fabio Estevam , Ian Ray , linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, devicetree@vger.kernel.org, kernel@collabora.com Subject: Re: [PATCHv4 5/6] misc: nxp-ezport: introduce EzPort support Message-ID: References: <20210609151235.48964-1-sebastian.reichel@collabora.com> <20210609151235.48964-6-sebastian.reichel@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210609151235.48964-6-sebastian.reichel@collabora.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 09, 2021 at 05:12:34PM +0200, Sebastian Reichel wrote: > Add new EzPort support code, which can be used to do > firmware updates of Kinetis coprocessors. The driver > is not usable on its own and thus not user selectable. > > Signed-off-by: Sebastian Reichel Why is this a separate module if only 1 driver needs this? Why not keep it together until you have a second user? And this module is not able to be unloaded ever? Why not? > +int ezport_flash(struct spi_device *spi, struct gpio_desc *reset, const char *fwname) > +{ > + int ret; > + > + ret = ezport_start_programming(spi, reset); > + if (ret) > + return ret; > + > + ret = ezport_firmware_load(spi, fwname); > + > + ezport_stop_programming(spi, reset); > + > + if (ret) > + dev_err(&spi->dev, "Failed to flash firmware: %d\n", ret); %pe perhaps instead of %d? > + else > + dev_dbg(&spi->dev, "Finished FW flashing!\n"); > + > + return ret; > +} > +EXPORT_SYMBOL_GPL(ezport_flash); > + > +/** > + * ezport_verify - verify device firmware > + * @spi: SPI device for NXP EzPort interface > + * @reset: the gpio connected to the device reset pin > + * @fwname: filename of the firmware that should be compared > + * > + * Context: can sleep > + * > + * Return: 0 on success; negative errno on failure > + */ > +int ezport_verify(struct spi_device *spi, struct gpio_desc *reset, const char *fwname) > +{ > + int ret; > + > + ret = ezport_start_programming(spi, reset); > + if (ret) > + return ret; > + > + ret = ezport_firmware_verify(spi, fwname); > + > + ezport_stop_programming(spi, reset); > + > + if (ret) > + dev_err(&spi->dev, "Failed to verify firmware: %d\n", ret); Same here, %pe? > + > + return ret; > +} > +EXPORT_SYMBOL_GPL(ezport_verify); > + > +MODULE_DESCRIPTION("NXP EzPort protocol support"); > +MODULE_AUTHOR("Sebastian Reichel "); > +MODULE_LICENSE("GPL"); > diff --git a/include/linux/platform_data/nxp-ezport.h b/include/linux/platform_data/nxp-ezport.h > new file mode 100644 > index 000000000000..b0a2af9c1285 > --- /dev/null > +++ b/include/linux/platform_data/nxp-ezport.h > @@ -0,0 +1,9 @@ > +/* SPDX-License-Identifier: GPL-2.0+ */ This license does NOT match up with the .c file's license. Why? thanks, greg k-h