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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5882BC7EE43 for ; Thu, 24 Aug 2023 11:41:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238814AbjHXLkw (ORCPT ); Thu, 24 Aug 2023 07:40:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241047AbjHXLkl (ORCPT ); Thu, 24 Aug 2023 07:40:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 795861987; Thu, 24 Aug 2023 04:40:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BF1C76451E; Thu, 24 Aug 2023 11:40:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BE8BC433C8; Thu, 24 Aug 2023 11:40:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1692877238; bh=Hc4V3VNJYc6/BXVoldkNqz2vHuG+cGO8fUbta2UGr8c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GB4gnzuUmF/ACHrJcy/9WckgBVFxls3bxrOyEhu33uz6EZSrBYmOKwBGBBf/aqcLL rDifer/+1bO8ULHmjNQCJXcXJxzOMF2xYRGA4iZoaIKQUIXwWNQV5a3Woh72EYztip 3ln6E7RMLtGlCNGGfauyGnszI6Y9r6psiBnR9xiI= Date: Thu, 24 Aug 2023 13:40:35 +0200 From: Greg KH To: Martin =?utf-8?B?WmHFpW92acSN?= Cc: linux-kernel@vger.kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, linus.walleij@linaro.org, quic_jhugo@quicinc.com, nipun.gupta@amd.com, tzimmermann@suse.de, ogabbay@kernel.org, mathieu.poirier@linaro.org, axboe@kernel.dk, damien.lemoal@opensource.wdc.com, linux@zary.sk, arnd@arndb.de, yangyicong@hisilicon.com, benjamin.tissoires@redhat.com, masahiroy@kernel.org, jacek.lawrynowicz@linux.intel.com, geert+renesas@glider.be, devicetree@vger.kernel.org, andriy.shevchenko@intel.com Subject: Re: [PATCHv5 2/4] wiegand: add Wiegand bus driver Message-ID: <2023082420-quaking-barley-47b4@gregkh> References: <20230824111015.57765-1-m.zatovic1@gmail.com> <20230824111015.57765-3-m.zatovic1@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230824111015.57765-3-m.zatovic1@gmail.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Thu, Aug 24, 2023 at 01:10:13PM +0200, Martin Zaťovič wrote: > +static inline void wiegand_controller_put(void *ptr) Why is this a void *? It should be "struct wiegand_controller *" Please never use void * if at all possible. > +static inline void wiegand_unregister_driver(struct wiegand_driver *wdrv) > +{ > + if (wdrv) How could this ever be true? > + driver_unregister(&wdrv->driver); > +} > + > +static inline struct wiegand_driver *to_wiegand_driver(struct device_driver *drv) > +{ > + return drv ? container_of(drv, struct wiegand_driver, driver) : NULL; How could drv be NULL? And you should make this a const *, right? thanks, greg k-h