Received: by 10.223.164.202 with SMTP id h10csp4339580wrb; Mon, 20 Nov 2017 13:56:20 -0800 (PST) X-Google-Smtp-Source: AGs4zMadeAJ0FHXGxC91BA5GxO9yF6ige0tNxytjiNRn21zX1g2ZTc7qsbqDsyUU3Iwfwbw/5ZzL X-Received: by 10.101.92.66 with SMTP id v2mr14621756pgr.151.1511214980771; Mon, 20 Nov 2017 13:56:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511214980; cv=none; d=google.com; s=arc-20160816; b=UwCwjKkEXGpsucajH9TOfgZzxtt/aoOgFb1kCUfKGXP3gZJNkXxljmPCt7eCIBPELA nOCA2l7rWbEb9b2/GaKilyC2zxUtXxZqnXM6zzbYU0upMWfvmq4SrhmEoDDTxZ5oJG12 NNF+gWSKULdDGQnxxjTs1QI3J8HBFee4rzWK3uueO4760d/eb5EQq0LPanEl9F9dTQxE DCRpn1AMc4m38rwrTeumgF4mZCpEZJKBWAVyNwKSdk1ijKIy6rh7LaFzmf6fsNv9VGfp Ol69ZwXjeBxMUROfqkp6YcrkaEpKhnpkd975urNDT864xA2dgApSZGEJw+jQWY5++AQU 93cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=MDaR1ZVsV8hMYZjjeD4oQ1jImaDOFCblk0yW9VP5ypE=; b=nuiriHP/la3sXTuCsxBCe8vcNMWWFBSjBG3XE4wyxHIWBDchI4r9FNIwkJMSO7Dw0E RYM/hyHVj73YER7Vk3CIctOw0p2b+E019/lkfy2iUKVRYsMtkKLll2u3TuHiAjr6fZgL 7xsfPYFw1CxReb5hy7AA+z4mmxE1LL8rdBQtBZdEZhyOI16YcR7N1f68lwiihDLJBlKX aUsIzdw690YxzFbUqfhndYXxBujmkBeU0p5XhjNJIycG31WCHnB5tK/2p5q6wN0brmyV eE+NapjGSVXxNpEfYt5iNLLaqHJ5DrXUG8e10YSbQgwCeJEHbt771DPdgV8wo0PhZ0aG pV8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=a8aJHNND; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j2si8994177pgs.345.2017.11.20.13.56.10; Mon, 20 Nov 2017 13:56:20 -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=@gmail.com header.s=20161025 header.b=a8aJHNND; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753097AbdKTVzd (ORCPT + 67 others); Mon, 20 Nov 2017 16:55:33 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:39285 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752930AbdKTVzc (ORCPT ); Mon, 20 Nov 2017 16:55:32 -0500 Received: by mail-lf0-f68.google.com with SMTP id x76so7160029lfb.6 for ; Mon, 20 Nov 2017 13:55:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=MDaR1ZVsV8hMYZjjeD4oQ1jImaDOFCblk0yW9VP5ypE=; b=a8aJHNNDGX4Wy+q8Zz/FRdR+HwZzvxIJXvmBnhg5uFx8tbybxoiHqp6zdiMnmv/rGM er/HugkugYYorqY+IzTMvK/3xnr4zhlVCPa20OWGMzKg+RLr3CWf9t5jx9OBOPYJFK1D e0uDrevCjQt9CMz7EOsXqMiMbwQWXzE4/pzbH/YJ0oFo4nmxI1bkDKQDvAqXvGAKnUB3 mV43nVDGJx86IvOp0nrecuho87t/eihpACWypVliHGhDnXmNG7cxj4yemeVkXEW4xmie J9UuN0tc6vyzAG322uzOqJgbAeqwdwjNzziYGtgTcLv7PlA8qH1z2+pNDsuo2Ge2WBfm kqlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=MDaR1ZVsV8hMYZjjeD4oQ1jImaDOFCblk0yW9VP5ypE=; b=k1bXhEMGgIFvL9ZhiCCPyKSAqBY+rvB+aV67EdT292qTIBfdWoXrhr/2eeW5/rFtWV FnDGs22Tf+JTdUwPTs3OJj8URQby1xTBwXbjC3pzvojVz9RsG+tPsfRL12Y3QG98plRi eeA1JsRgPhzw474vJW5Vgl66wMH1S9QGYx4yo0J9Uc5bPxnczWQOAph3Fl4qxR3UZ7cQ 5us87xLukXucPO7qUnuExb6vZIilnpZzz/g8xZ07c+vRp8wTsxOmG4h7bsZD4YHgMQ3M uBpdvReJ6FN5tXpGFF5wUzaKQvCW2lr6vWOZM3faekraHOkZuNQ3RGat32+RsSbTQ1+c S75w== X-Gm-Message-State: AJaThX6NcMLrtc7xc4lt4zu9rKnk2y0sOAKA7uJDKGHQGGvDJJTdIpGp WcEkv2i7eck3I3xcf1C8cbo= X-Received: by 10.25.1.88 with SMTP id 85mr3259589lfb.68.1511214930781; Mon, 20 Nov 2017 13:55:30 -0800 (PST) Received: from phobos.ciupak.eu ([31.130.108.122]) by smtp.gmail.com with ESMTPSA id i72sm2105329lfe.67.2017.11.20.13.55.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Nov 2017 13:55:29 -0800 (PST) Date: Tue, 21 Nov 2017 00:03:57 +0100 From: Marcin Ciupak To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org Subject: [PATCH 1/2] staging: pi433: fix (NULL device *) in log message Message-ID: <20479848fe04c923ffca8959ed1a7e32d2b07f36.1511218323.git.marcin.s.ciupak@gmail.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171013 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (NULL device *) is printed in log message in pi433_probe and pi433_get_minor functions due to device->dev being used prior to call to device_create function. Signed-off-by: Marcin Ciupak --- drivers/staging/pi433/pi433_if.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index d946838450d4..bc17676169cb 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -1051,7 +1051,7 @@ static int pi433_get_minor(struct pi433_device *device) device->minor = retval; retval = 0; } else if (retval == -ENOSPC) { - dev_err(device->dev, "too many pi433 devices\n"); + dev_err(&device->spi->dev, "too many pi433 devices\n"); retval = -EINVAL; } mutex_unlock(&minor_lock); @@ -1159,19 +1159,10 @@ static int pi433_probe(struct spi_device *spi) SET_CHECKED(rf69_set_output_power_level (spi, 13)); SET_CHECKED(rf69_set_antenna_impedance (spi, fiftyOhm)); - /* start tx thread */ - device->tx_task_struct = kthread_run(pi433_tx_thread, - device, - "pi433_tx_task"); - if (IS_ERR(device->tx_task_struct)) { - dev_dbg(device->dev, "start of send thread failed"); - goto send_thread_failed; - } - /* determ minor number */ retval = pi433_get_minor(device); if (retval) { - dev_dbg(device->dev, "get of minor number failed"); + dev_dbg(&spi->dev, "get of minor number failed"); goto minor_failed; } @@ -1194,6 +1185,15 @@ static int pi433_probe(struct spi_device *spi) device->minor); } + /* start tx thread */ + device->tx_task_struct = kthread_run(pi433_tx_thread, + device, + "pi433_tx_task"); + if (IS_ERR(device->tx_task_struct)) { + dev_dbg(device->dev, "start of send thread failed"); + goto send_thread_failed; + } + /* create cdev */ device->cdev = cdev_alloc(); device->cdev->owner = THIS_MODULE; @@ -1210,12 +1210,12 @@ static int pi433_probe(struct spi_device *spi) return 0; cdev_failed: + kthread_stop(device->tx_task_struct); +send_thread_failed: device_destroy(pi433_class, device->devt); device_create_failed: pi433_free_minor(device); minor_failed: - kthread_stop(device->tx_task_struct); -send_thread_failed: free_GPIOs(device); GPIO_failed: kfree(device); -- 2.15.0 From 1584697166366041337@xxx Tue Nov 21 17:23:06 +0000 2017 X-GM-THRID: 1584347411647594379 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread