linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: s.grosjean@peak-system.com
Cc: Wolfgang Grandegger <wg@grandegger.com>,
	Oliver Hartkopp <socketcan@hartkopp.net>,
	Linux CAN mailing list <linux-can@vger.kernel.org>
Subject: Re: [PATCH] Add PEAK System USB adapters core driver
Date: Wed, 11 Jan 2012 10:50:20 +0100	[thread overview]
Message-ID: <4F0D5B5C.2040205@pengutronix.de> (raw)
In-Reply-To: <4F0D5529.7020208@peak-system.com>

[-- Attachment #1: Type: text/plain, Size: 3618 bytes --]

On 01/11/2012 10:23 AM, Grosjean Stephane wrote:
>>>>>   drivers/net/can/usb/Kconfig                  |    1 +
>>>>>   drivers/net/can/usb/Makefile                 |    1 +
>>>>>   drivers/net/can/usb/peak_usb/Kconfig         |   19 +
>>>>>   drivers/net/can/usb/peak_usb/Makefile        |   10 +
>>>>>   drivers/net/can/usb/peak_usb/pcan_usb_core.c |  893
>>>>> ++++++++++++++++++++++++++
>>>>>   drivers/net/can/usb/peak_usb/peak_usb.h      |  149 +++++
>>>>>   6 files changed, 1073 insertions(+), 0 deletions(-)
>>>>>   create mode 100644 drivers/net/can/usb/peak_usb/Kconfig
>>>>>   create mode 100644 drivers/net/can/usb/peak_usb/Makefile
>>>>>   create mode 100644 drivers/net/can/usb/peak_usb/pcan_usb_core.c
>>>> Why not naming the file peak_usb.c? You already use "peak_usb" for the
>>>> header file as function prefix inside!
>>>
>>> AFAIR the driver built results in peak_usb.ko
>>>
>>> And the driver contains the pcan_usb.c and pcan_usb_pro.c
>>>
>>> If it's possible from the build process pcan_usb_core.c should be
>>> renamed to
>>> peak_usb.c - that's right.
> 
> What I know from the build process doesn't enable to do that (that is,
> building module.ko from module.c **and** file.c:
> 
> obj-$(CONFIG_CAN_PEAK_USB) += peak_usb.o pcan_usb.o pcan_usb_pro.o
> 
> linux-can-next$
>   CHK     include/linux/version.h
>   CHK     include/generated/utsrelease.h
>   CALL    scripts/checksyscalls.sh
>   CHK     include/generated/compile.h
>   CC [M]  drivers/net/can/usb/peak_usb/pcan_usb.o
>   CC [M]  drivers/net/can/usb/peak_usb/pcan_usb_pro.o
> Kernel: arch/x86/boot/bzImage is ready  (#3)
>   Building modules, stage 2.
>   MODPOST 3012 modules
> ERROR: "pcan_usb_pro" [drivers/net/can/usb/peak_usb/peak_usb.ko] undefined!
> ERROR: "pcan_usb" [drivers/net/can/usb/peak_usb/peak_usb.ko] undefined!
> ERROR: "peak_usb_set_ts_now"
> [drivers/net/can/usb/peak_usb/pcan_usb_pro.ko] undefined!
> ERROR: "peak_usb_get_ts_tv"
> [drivers/net/can/usb/peak_usb/pcan_usb_pro.ko] undefined!
> ERROR: "dump_mem" [drivers/net/can/usb/peak_usb/pcan_usb_pro.ko] undefined!
> ERROR: "peak_usb_init_time_ref"
> [drivers/net/can/usb/peak_usb/pcan_usb_pro.ko] undefined!
> ERROR: "peak_usb_set_ts_now" [drivers/net/can/usb/peak_usb/pcan_usb.ko]
> undefined!
> ERROR: "peak_usb_update_ts_now"
> [drivers/net/can/usb/peak_usb/pcan_usb.ko] undefined!
> ERROR: "peak_usb_get_ts_tv" [drivers/net/can/usb/peak_usb/pcan_usb.ko]
> undefined!
> ERROR: "peak_usb_init_time_ref"
> [drivers/net/can/usb/peak_usb/pcan_usb.ko] undefined!
> WARNING: modpost: Found 23 section mismatch(es).
> To see full details build your kernel with:
> 'make CONFIG_DEBUG_SECTION_MISMATCH=y'
> make[1]: *** [__modpost] Error 1
> make: *** [modules] Error 2
> linux-can-next$
> 
> ... but I'm not an expert in the mainline kernel. Is there another way
> to do that?

Documentation/kbuild/makefiles.txt has this example:

	obj-$(CONFIG_EXT2_FS) += ext2.o
	ext2-y := balloc.o dir.o file.o ialloc.o inode.o ioctl.o \
		namei.o super.o symlink.o
	ext2-$(CONFIG_EXT2_FS_XATTR) += xattr.o xattr_user.o \
		xattr_trusted.o

Which translates into (untested, though):

	obj-$(CONFIG_CAN_PEAK_USB) += peak_usb.o
	peak_usb-y := peak_usb_core.o pcan_usb.o pcan_usb_pro.o

With a peak_usb_core.c file.

Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

  reply	other threads:[~2012-01-11  9:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-22 13:11 [PATCH] Add PEAK System USB adapters core driver Stephane Grosjean
2011-12-22 21:41 ` Sebastian Haas
2011-12-23  9:33   ` Grosjean Stephane
2011-12-23 11:48     ` dev
2012-01-10 12:53   ` Marc Kleine-Budde
2012-01-10 10:17 ` Wolfgang Grandegger
2012-01-10 15:22   ` Oliver Hartkopp
2012-01-10 15:35     ` Wolfgang Grandegger
2012-01-11  9:23       ` Grosjean Stephane
2012-01-11  9:50         ` Marc Kleine-Budde [this message]
2012-01-11 10:09           ` Grosjean Stephane
2012-01-11 10:12           ` Wolfgang Grandegger
2012-01-11 10:29             ` Oliver Hartkopp
2012-01-11 12:28               ` Wolfgang Grandegger
2012-01-11  9:59         ` Wolfgang Grandegger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F0D5B5C.2040205@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=s.grosjean@peak-system.com \
    --cc=socketcan@hartkopp.net \
    --cc=wg@grandegger.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).